Submission #619223

#TimeUsernameProblemLanguageResultExecution timeMemory
619223A_DScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { /* ... */ } void orderCoins() { set<int> meeee; for(int i=1;i<=6;i++)meeee.insert(i); int W[] = {6, 6, 6, 6, 6, 6}; int cnt=1; int u=getLightest(1,2,3); int v=getLightest(4,5,6); set<int> st; st.insert(1);st.insert(2);st.insert(3);st.insert(4);st.insert(5);st.insert(6); st.erase(u);st.erase(v); int c=getLightest(u,v,*st.begin()); int he=c; W[c]=cnt++; meeee.erase(c); vector<int> vec; for(auto x:meeee)vec.push_back(x); u=getLightest(vec[0],vec[1],vec[2]); c=getLightest(vec[3],vec[4],u); W[c]=cnt++; meeee.erase(c); vec.clear(); for(auto x:meeee)vec.push_back(x); int v=vec[0]; u=getLightest(vec[0],vec[1],vec[2]); if(v==u)v=vec[1]; c=getLightest(vec[3],v,u); W[c]=cnt++; meeee.erase(c); vec.clear(); for(auto x:meeee)vec.push_back(x); c=getLightest(vec[0],vec[1],vec[2]); W[c]=cnt++; meeee.erase(c); vec.clear(); for(auto x:meeee)vec.push_back(x); u=getMedian(vec[0],vec[1],he); W[u]=cnt++; meeee.erase(c); 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) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:38:9: error: redeclaration of 'int v'
   38 |     int v=vec[0];
      |         ^
scales.cpp:19:9: note: 'int v' previously declared here
   19 |     int v=getLightest(4,5,6);
      |         ^