Submission #485455

#TimeUsernameProblemLanguageResultExecution timeMemory
485455AmirElarbiScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "scales.h" #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define fi first #define se second #define INF 1e9 #define eps 1e-7 #define eps1 1e-25 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 1e5+5 #define V 450 using namespace std; const int MOD = 1e9+7; const int nax = 200005; int w[6],a[6]; void orderCoins() { memset(a, 0, sizeof a); memset(w, 0, sizeof w); int light = getLightest(1,2,3), hev = getHeaviest(1,2,3); light = getLightest(light,4,5), hev = getHeaviest(hev,4,5); //cout << light << endl; if(light!=4) light = getLightest(light,4,6); else light = getLightest(light,5,6); if(hev!=4) hev = getHeaviest(hev,4,6); else hev = getHeaviest(hev,5,6); w[0] = light; a[light-1] = 1; vi s; for(int i = 0; i < 6; i++){ if(!a[i]){s.pb(i+1);} } int res = getNextLightest(s[0],s[1],s[2],light); light = w[1] = getLightest(res,s[3],s[4]); a[light-1] = true; s.clear(); for(int i = 0; i < 6; i++){ if(!a[i]){s.pb(i+1);} } res = getNextLightest(s[0],s[1],s[2],light); w[2] = light = getMedian(res,s[3],w[0]); a[light-1] = true; s.clear(); for(int i = 0; i < 6; i++){ if(!a[i]){s.pb(i+1);} } w[3] = light = getNextLightest(s[0],s[1],s[2],light); a[light-1] = true; w[5] = hev; for(int i = 0; i < 6; i++){ if(!a[i]){w[4] = i+1; break;} } }

Compilation message (stderr)

scales.cpp: In function 'void orderCoins()':
scales.cpp:28:17: error: 'getLightest' was not declared in this scope
   28 |     int light = getLightest(1,2,3), hev = getHeaviest(1,2,3);
      |                 ^~~~~~~~~~~
scales.cpp:29:37: error: 'hev' was not declared in this scope
   29 |     light = getLightest(light,4,5), hev = getHeaviest(hev,4,5);
      |                                     ^~~
scales.cpp:29:43: error: 'getHeaviest' was not declared in this scope
   29 |     light = getLightest(light,4,5), hev = getHeaviest(hev,4,5);
      |                                           ^~~~~~~~~~~
scales.cpp:46:15: error: 'getNextLightest' was not declared in this scope
   46 |     int res = getNextLightest(s[0],s[1],s[2],light);
      |               ^~~~~~~~~~~~~~~
scales.cpp:54:20: error: 'getMedian' was not declared in this scope
   54 |     w[2] = light = getMedian(res,s[3],w[0]);
      |                    ^~~~~~~~~