8000 Merge pull request #274 from SciEm/1476.cpp · w10gd/basic-algo-lecture@6262b7b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6262b7b

Browse files
Merge pull request encrypted-def#274 from SciEm/1476.cpp
Update 1476.cpp
2 parents 33caf23 + e168c88 commit 6262b7b

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

0x12/solutions/1476.cpp

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

7-
int main(void){
7+
int e, s, m;
8+
9+
int main() {
810
ios::sync_with_stdio(0);
911
cin.tie(0);
10-
11-
}
12+
13+
cin >> e >> s >> m;
14+
e--, s--, m--;
15+
16+
int i = e;
17+
while(i % 28 != s) i += 15;
18+
19+
int l = lcm(15, 28);
20+
while(i % 19 != m) i += l;
21+
c 484A out << i + 1;
22+
}
23+
/*
24+
C++17부터 numeric 헤더에 lcm 함수가 내장되어 있음
25+
*/

0 commit comments

Comments
 (0)
0