[C/C++] 백준 2309


[C/C++] 백준 2309

문제 소스 코드 #include <iostream> #include <vector> using namespace std; int total_sum = 0; vector<int> total; void find_ans() { for(int j=0;j<9;j++) { int temp_sum = total[j]; for(int k=j+1;k<9;k++) { temp_sum += total[k]; if(total_sum - temp_sum == 100) { total[j] = 0; total[k] = 0; return ; } temp_sum = total[j]; } } } int main() { for(int i=0; i<9;i++) { int num; scanf("%d", &num); total.push_back(num); total_sum += total[i]; } find_ans(); sort(total.begin(), total.end()); for(int j=0;j<9;j++) { ...



원문링크 : [C/C++] 백준 2309