Submission #1219995

#TimeUsernameProblemLanguageResultExecution timeMemory
1219995Marco_EscandonWombats (IOI13_wombats)C++20
Compilation error
0 ms0 KiB
#include "wombats.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define x first #define y second void init(int T) { } void orderCoins() { int W[6]; deque<pair<ll,ll>> p1={{0,1},{0,2},{0,3}},p2={{0,4},{0,5},{0,6}}; ll t1=getHeaviest(p1[0].y,p1[1].y,p1[2].y); p1[t1-1].x=20; t1=getMedian(p1[0].y,p1[1].y,p1[2].y); p1[t1-1].x=10; sort(p1.begin(),p1.end()); t1=getHeaviest(p2[0].y,p2[1].y,p2[2].y); p2[t1-3-1].x=20; t1=getMedian(p2[0].y,p2[1].y,p2[2].y); p2[t1-3-1].x=10; sort(p2.begin(),p2.end()); ll s=0; while(p1.size()!=0&&p2.size()!=0) { vector<ll> q; for(int i=0; i<min(2,(int)p1.size()); i++) { q.push_back(p1[i].y); } int asdf=q.size(); for(int i=0; i<min(3-(int)asdf,(int)p2.size()); i++) { q.push_back(p2[i].y); } ll temp=getLightest(q[0],q[1],q[2]); if(temp==p1.front().y) { W[s]=p1.front().y;p1.pop_front(); s++; } else { W[s]=p2.front().y;p2.pop_front(); s++; } if(p1.size()+p2.size()==2) { if(p1.size()==0||p2.size()==0) break; temp=getMedian(q[0],q[1],q[2]); if(temp==p1.front().y) { W[s]=p1.front().y;p1.pop_front(); s++; } else { W[s]=p2.front().y;p2.pop_front(); s++; } break; } } while(p1.size()!=0) { W[s]=p1.front().y;p1.pop_front(); s++; } while(p2.size()!=0) { W[s]=p2.front().y;p2.pop_front(); s++; } answer(W); }

Compilation message (stderr)

wombats.cpp: In function 'void orderCoins()':
wombats.cpp:13:11: error: 'getHeaviest' was not declared in this scope
   13 |     ll t1=getHeaviest(p1[0].y,p1[1].y,p1[2].y); p1[t1-1].x=20;
      |           ^~~~~~~~~~~
wombats.cpp:14:8: error: 'getMedian' was not declared in this scope
   14 |     t1=getMedian(p1[0].y,p1[1].y,p1[2].y); p1[t1-1].x=10;
      |        ^~~~~~~~~
wombats.cpp:33:17: error: 'getLightest' was not declared in this scope
   33 |         ll temp=getLightest(q[0],q[1],q[2]);
      |                 ^~~~~~~~~~~
wombats.cpp:71:5: error: 'answer' was not declared in this scope
   71 |     answer(W);
      |     ^~~~~~