Submission #261423

#TimeUsernameProblemLanguageResultExecution timeMemory
261423ElyesChaabouniScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
/*#pragma GCC optimize("O3")*/ #include<bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //#define ordered_set tree<int, null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> #define eps 1e-9 #define MOD1 998244353 #define MOD2 1000000007 #define INV_10 299473306 #define INF 1000000001 #define PI 3.14159265358979323846 using namespace std; void init(int T) { return; } void orderCoins() { int ans[6]; set<int>s; s.insert(1); s.insert(2); s.insert(3); int a[3]; a[0]=getLightest(1, 2, 3); s.erase(a[0]); a[2]=getHeaviest(1, 2, 3); s.erase(a[2]); a[1]=(*s.begin()); s.clear(); s.insert(4); s.insert(5); s.insert(6); int b[3]; b[0]=getLightest(4, 5, 6); s.erase(b[0]); b[2]=getHeaviest(4, 5, 6); s.erase(b[2]); b[1]=(*s.begin()); s.clear(); vector<int>v; for(int i = 0; i < 3; i++) v.push_back(b[i]); int x=getNextLightest(a[0], a[1], a[2], b[2]); if(x==a[0]) { int y = getMedian(a[0], b[1], b[2]); if(y==b[2]) { for(int i = 0; i < 3; i++) ans[i]=b[i]; for(int i = 0; i < 3; i++) ans[3+i]=a[i]; return ans; } else if(y==a[0]) v.insert(v.begin()+2, a[0]); else { int d=getMedian(a[0], b[0], b[1]); if(d==a[0]) v.insert(v.begin()+1, a[0]); else v.insert(v.begin(), a[0]); } for(int i = 1; i < 3; i++) { int d=getNextLightest(b[0], b[1], b[2], a[i]); for(int j = 0; j < v.size(); j++) { if(v[j]==d) { v.insert(v.begin(), a[i]); break; } } } } else { int pos=2; if(x==a[1]) { pos=1; v.push_back(a[1]); } v.push_back(a[2]); for(int i = 0; i < pos; i++) { int d=getNextLightest(b[0], b[1], b[2], a[i]); for(int j = 0; j < v.size(); j++) { if(v[j]==d) { v.insert(v.begin(), a[i]); break; } } } } for(int i = 0; i < 6; i++) ans[i]=v[i]; answer(ans); } //size

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:13:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:24:10: error: 'getLightest' was not declared in this scope
     a[0]=getLightest(1, 2, 3);
          ^~~~~~~~~~~
scales.cpp:24:10: note: suggested alternative: 'gettext'
     a[0]=getLightest(1, 2, 3);
          ^~~~~~~~~~~
          gettext
scales.cpp:26:10: error: 'getHeaviest' was not declared in this scope
     a[2]=getHeaviest(1, 2, 3);
          ^~~~~~~~~~~
scales.cpp:43:11: error: 'getNextLightest' was not declared in this scope
     int x=getNextLightest(a[0], a[1], a[2], b[2]);
           ^~~~~~~~~~~~~~~
scales.cpp:46:14: error: 'getMedian' was not declared in this scope
      int y = getMedian(a[0], b[1], b[2]);
              ^~~~~~~~~
scales.cpp:46:14: note: suggested alternative: 'getdelim'
      int y = getMedian(a[0], b[1], b[2]);
              ^~~~~~~~~
              getdelim
scales.cpp:53:14: error: return-statement with a value, in function returning 'void' [-fpermissive]
       return ans;
              ^~~
scales.cpp:68:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int j = 0; j < v.size(); j++)
                      ~~^~~~~~~~~~
scales.cpp:90:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int j = 0; j < v.size(); j++)
                      ~~^~~~~~~~~~
scales.cpp:102:5: error: 'answer' was not declared in this scope
     answer(ans);
     ^~~~~~
scales.cpp:102:5: note: suggested alternative: 'ans'
     answer(ans);
     ^~~~~~
     ans