제출 #407124

#제출 시각아이디문제언어결과실행 시간메모리
407124MDario저울 (IOI15_scales)C++11
57.12 / 100
1 ms204 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define F first #define S second void init(int T) { return ; } void orderCoins() { /* ... */ int w[] = {1, 2, 3, 4, 5, 6}, c; vector<int> v1, v2; c=6; v1.push_back(getLightest(1, 2, 3)); c-=v1.back(); v1.push_back(getMedian(1, 2, 3)); c-=v1.back(); v1.push_back(c); c=4+5+6; v2.push_back(getLightest(4, 5, 6)); c-=v2.back(); v2.push_back(getMedian(4, 5, 6)); c-=v2.back(); v2.push_back(c); int c1=0, c2=0; while(c1<=2||c2<=2){ if(c1>c2){ swap(c1, c2); swap(v1, v2); } if(c2==3){ for(int i=c1; i<=2; i++){ w[c2+c1]=v1[c1]; c1++; } } else if(c1<=1){ c=getMedian(v1[c1], v2[c2], v1[c1+1]); if(c==v1[c1]){ w[c1+c2]=v2[c2]; c2++; } else if(c==v1[c1+1]){ w[c1+c2]=v1[c1]; c1++; w[c1+c2]=v1[c1]; c1++; } else{ w[c1+c2]=v1[c1]; c1++; w[c1+c2]=v2[c2]; c2++; } } else if(c1==2&&c2==2){ c=getHeaviest(v1[c1], v2[c2], v1[c1-1]); if(c==v1[c1]){ w[c1+c2]=v2[c2]; c2++; w[c1+c2]=v1[c1]; c1++; } else{ w[c1+c2]=v1[c1]; c1++; w[c1+c2]=v2[c2]; c2++; } } } answer(w); return ; }

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

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