제출 #470190

#제출 시각아이디문제언어결과실행 시간메모리
470190Cross_Ratio저울 (IOI15_scales)C++14
56.08 / 100
1 ms204 KiB
#include <bits/stdc++.h> #include "scales.h" using namespace std; void init(int T) {return;} void orderCoins() { int a = getLightest(1, 2, 3); int b = getMedian(1, 2, 3); int c = 6 - a - b; //assert(getHeaviest(1,2,3)==c); int d = getLightest(4, 5 ,6); int e = getMedian(4, 5, 6); int f = 15 - d - e; //assert(getHeaviest(4,5,6)==f); // a b c / d e f int k1 = getNextLightest(a, b, c, e); if(k1 == b) { // a e b c //assert(getMedian(a,e,b)==e); int k2 = getNextLightest(e, b, c, f); int k3 = getMedian(a, d, e); if(k2==e) { if(k3==a) { int ans[6] = {d,a,e,b,c,f}; answer(ans); return; } if(k3==d) { int ans[6] = {a,d,e,b,c,f}; answer(ans); return; } } if(k2==b) { if(k3==a) { int ans[6] = {d,a,e,f,b,c}; answer(ans); return; } if(k3==d) { int ans[6] = {a,d,e,f,b,c}; answer(ans); return; } } if(k2==c) { if(k3==a) { int ans[6] = {d,a,e,b,f,c}; answer(ans); return; } if(k3==d) { int ans[6] = {a,d,e,b,f,c}; answer(ans); return; } } } if(k1 == c) { //a b e c //assert(getMedian(b,e,c)==e); int k2 = getNextLightest(a, b, e, d); int k3 = getMedian(e, c, f); if(k2==a) { if(k3==c) { int ans[6] = {d,a,b,e,c,f}; answer(ans); return; } if(k3==f) { int ans[6] = {d,a,b,e,f,c}; answer(ans); return; } } if(k2==b) { if(k3==c) { int ans[6] = {a,d,b,e,c,f}; answer(ans); return; } if(k3==f) { int ans[6] = {a,d,b,e,f,c}; answer(ans); return; } } if(k2==e) { if(k3==c) { int ans[6] = {a,b,d,e,c,f}; answer(ans); return; } if(k3==f) { int ans[6] = {a,b,d,e,f,c}; answer(ans); return; } } } // e a b c or a b c e int k2 = getMedian(d, e, a); if(k2 == d) { //a (b c d) e f int k3 = getNextLightest(a,b,c,d); if(k3==a) { int ans[6] = {a,b,c,d,e,f}; answer(ans); return; } if(k3==b) { int ans[6] = {a,d,b,c,e,f}; answer(ans); return; } if(k3==c) { int ans[6] = {a,b,d,c,e,f}; answer(ans); return; } } if(k2 == e) { // d e a b c int k3 = getNextLightest(a,b,c,f); if(k3==b) { int ans[6] = {d,e,a,f,b,c}; answer(ans); return; } if(k3==c) { int ans[6] = {d,e,a,b,f,c}; answer(ans); return; } if(k3==a) { int k4 = getMedian(e,a,f); assert(k4 != e); if(k4==a) { int ans[6] = {d,e,a,b,c,f}; answer(ans); return; } if(k4==f) { int ans[6] = {d,e,f,a,b,c}; answer(ans); return; } } } if(k2 == a) { //d a e -> d a b c e f int ans[6] = {d,a,b,c,e,f}; answer(ans); return; } }

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

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