제출 #802704

#제출 시각아이디문제언어결과실행 시간메모리
802704Liudas저울 (IOI15_scales)C++17
71.43 / 100
1 ms304 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void orderCoins(){ int arr[6]; vector<int> b = {1,2,3,4,5,6}; int ans = getHeaviest(1,2,3); int ans2 = getHeaviest(4, 5, 6); int ans3 = getHeaviest(ans, ans2, (ans == 3? 2: 3)); arr[5] = ans3; b.erase(find(b.begin(), b.end(), ans3)); if(ans == ans3){ b.erase(find(b.begin(), b.end(), ans2)); ans3 = getHeaviest(b[0], b[1], ans2); b.push_back(ans2); } else{ b.erase(find(b.begin(), b.end(), ans)); ans3 = getHeaviest(b[2], b[3], ans); b.push_back(ans); } b.erase(find(b.begin(), b.end(), ans3)); arr[4] = ans3; int c1 = b[0], c2 = b[1], c3 = b[2], c4; ans = getLightest(b[0],b[1],b[2]); b.erase(find(b.begin(), b.end(), ans)); ans2 = getHeaviest(b[0], b[1], b[2]); b.push_back(ans); b.erase(find(b.begin(), b.end(), ans2)); arr[3] = ans2; ans3 = getMedian(b[0], b[1], b[2]); if(ans == c1){ b.erase(find(b.begin(), b.end(), c1)); if(ans2 == c2){ b.erase(find(b.begin(), b.end(), c3)); c4 = c3; } else{ b.erase(find(b.begin(), b.end(), c2)); c4 = c2; } if(ans3 == ans){ arr[0] = b[0]; arr[1] = ans; arr[2] = c4; } else if(ans3 == c4){ arr[0] = ans; arr[1] = c4; arr[2] = b[0]; } else{ arr[0] = ans; arr[1] = b[0]; arr[2] = c4; } } if(ans == c2){ b.erase(find(b.begin(), b.end(), c2)); if(ans2 == c1){ b.erase(find(b.begin(), b.end(), c3)); c4 = c3; } else{ b.erase(find(b.begin(), b.end(), c1)); c4 = c1; } if(ans3 == ans){ arr[0] = b[0]; arr[1] = ans; arr[2] = c4; } else if(ans3 == c4){ arr[0] = ans; arr[1] = c4; arr[2] = b[0]; } else{ arr[0] = ans; arr[1] = b[0]; arr[2] = c4; } } if(ans == c3){ b.erase(find(b.begin(), b.end(), c3)); if(ans2 == c2){ b.erase(find(b.begin(), b.end(), c1)); c4 = c1; } else{ b.erase(find(b.begin(), b.end(), c2)); c4 = c2; } if(ans3 == ans){ arr[0] = b[0]; arr[1] = ans; arr[2] = c4; } else if(ans3 == c4){ arr[0] = ans; arr[1] = c4; arr[2] = b[0]; } else{ arr[0] = ans; arr[1] = b[0]; arr[2] = c4; } } answer(arr); } void init(int T){ }

컴파일 시 표준 에러 (stderr) 메시지

scales.cpp: In function 'void init(int)':
scales.cpp:113:15: warning: unused parameter 'T' [-Wunused-parameter]
  113 | void init(int T){
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...