제출 #619464

#제출 시각아이디문제언어결과실행 시간메모리
619464A_D저울 (IOI15_scales)C++14
0 / 100
1 ms468 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { /* ... */ } void orderCoins() { int W[] = {6, 6, 6, 6, 6, 6}; vector<int> vec1; vector<int> vec2; set<int> st; vec1.push_back(getLightest(1,2,3)); vec1.push_back(getMedian(1,2,3)); st.insert(1);st.insert(2);st.insert(3); st.erase(vec1[0]);st.erase(vec1[1]); vec1.push_back(*st.begin()); st.clear(); vec2.push_back(getLightest(4,5,6)); vec2.push_back(getMedian(4,5,6)); st.insert(4);st.insert(5);st.insert(6); st.erase(vec2[0]);st.erase(vec2[1]); vec2.push_back(*st.begin()); st.clear(); int l=0,r=0; int cnt=0; while(cnt<6){ if(l==3){ W[cnt]=vec1[l]; l++; cnt++; continue; } if(r==3){ W[cnt]=vec2[r]; r++; cnt++; continue; } if(l==2&&r==2){ int u=getMedian(vec1[0],vec1[l],vec2[r]); W[cnt]=u; cnt++; if(u==vec1[l]){ l++; } else{ r++; } continue; } if(l<2){ int u=getLightest(vec1[2],vec1[l],vec2[r]); W[cnt]=u; cnt++; if(u==vec1[l]){ l++; } else{ r++; } continue; } if(r<2){ int u=getLightest(vec2[2],vec1[l],vec2[r]); W[cnt]=u; cnt++; if(u==vec1[l]){ l++; } else{ r++; } continue; } assert(0); } answer(W); }

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

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