Submission #619366

#TimeUsernameProblemLanguageResultExecution timeMemory
619366A_DScales (IOI15_scales)C++14
0 / 100
1 ms304 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(l<3&&r<3){ if(l==3){ W[cnt++]=vec1[l]; l++; continue; } if(r==3){ W[cnt++]=vec2[r]; r++; continue; } if(l==2&&r==2){ int u=getMedian(vec1[0],vec1[l],vec2[r]); W[cnt++]=u; if(u==vec1[l]){ l++; } else{ r++; } continue; } if(l<2){ int u=getLightest(vec1[2],vec1[l],vec2[r]); W[cnt++]=u; if(u==vec1[l]){ l++; } else{ r++; } continue; } if(r<2){ int u=getLightest(vec2[2],vec1[l],vec2[r]); W[cnt++]=u; if(u==vec1[l]){ l++; } else{ r++; } continue; } assert(0); } answer(W); }

Compilation message (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...