8000 Update 10171.cpp · twinkite/basic-algo-lecture@606a546 · GitHub
[go: up one dir, main page]

Skip to content

Commit 606a546

Browse files
committed
Update 10171.cpp
1 parent 03ef87e commit 606a546

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

0x02/solutions/2480.cpp

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

7-
int main(void){
8-
ios::sync_with_stdio(0);
9-
cin.tie(0);
10-
7+
int rule1(int x){
8+
return 10000+x*1000;
9+
}
10+
11+
int rule2(int x){
12+
return 1000+x*100;
13+
}
14+
15+
int rule3(int x){
16+
return x*100;
17+
}
18+
19+
int main(){
20+
ios_base::sync_with_stdio(0);
21+
cin.tie(0);
22+
int res;
23+
int arr[4];
24+
for(int i=0;i<3;i++){
25+
cin>>arr[i];
26+
}
27+
28+
if(arr[0]==arr[1] && arr[1]==arr[2] && arr[0]==arr[2]) res = rule1(arr[0]);
29+
else if(arr[0]!=arr[1] && arr[1]!=arr[2] && arr[0]!=arr[2]){
30+
sort(arr, arr+3);
31+
res = rule3(arr[2]);
32+
} else{
33+
if(arr[0]==arr[1]) res = rule2(arr[0]);
34+
else if(arr[1]==arr[2]) res = rule2(arr[1]);
35+
else res = rule2(arr[0]);
36+
}
37+
cout<<res;
38+
return 0;
1139
}

0 commit comments

Comments
 (0)
0