-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboj2309.cpp
More file actions
42 lines (39 loc) · 782 Bytes
/
boj2309.cpp
File metadata and controls
42 lines (39 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
inline void Quick_IO(){
ios_base :: sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
int main(){
Quick_IO();
// O(n^2)
int arr[9];
int total = 0;
int i, j;
bool flag = false;
for (int & i : arr) {
cin>>i;
total += i;
}
sort(arr, arr+9);
for (i = 0; i < 9; ++i) {
for (j = i+1; j < 9; ++j) {
if(total - arr[i] - arr[j]==100){
flag = true;
break;
}
}
if(flag) break;
}
for(int k = 0;k<9;k++){
if(k==i) continue;
if(k==j) continue;
cout<<arr[k]<<"\n";
}
return 0;
}