8000 Update 1476.cpp · spy03128/basic-algo-lecture@e168c88 · GitHub
[go: up one dir, main page]

Skip to content

Commit e168c88

Browse files
Update 1476.cpp
1 parent c8b0b05 commit e168c88

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

0x12/solutions/1476.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Authored by : SciEm
2-
// Co-authored by : -
3-
// http://boj.kr/78692d69bc014987b88c4b288ca1c95d
2+
// Co-authored by : BaaaaaaaaaaarkingDog
3+
// http://boj.kr/802e3e33606e4782872c101b44c20e18
44
#include <bits/stdc++.h>
55
using namespace std;
66

@@ -14,9 +14,12 @@ int main() {
1414
e--, s--, m--;
1515

1616
int i = e;
17-
for (; i % 28 != s; i += 15);
17+
while(i % 28 != s) i += 15;
1818

1919
int l = lcm(15, 28);
20-
for (; i % 19 != m; i += l);
20+
while(i % 19 != m) i += l;
2121
cout << i + 1;
2222
}
23+
/*
24+
C++17부터 numeric 헤더에 lcm 함수가 내장되어 있음
25+
*/

0 commit comments

Comments
 (0)
0