Submission #97494

#TimeUsernameProblemLanguageResultExecution timeMemory
97494wilwxkScales (IOI15_scales)C++11
0 / 100
4 ms512 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int t) { mt19937 rng(time(0)+t); } void orderCoins() { int respf[]={1, 2, 3, 4, 5, 6}; vector<int> resp; int v[]={0, 1, 2, 3, 4, 5, 6}; random_shuffle(v+1, v+7); int a, b; a=getLightest(v[1], v[2], v[3]); if(v[2]==a) swap(v[1], v[2]); if(v[3]==a) swap(v[1], v[3]); a=getMedian(v[1], v[2], v[3]); if(v[3]==a) swap(v[2], v[3]); a=getLightest(v[4], v[5], v[6]); if(v[5]==a) swap(v[4], v[5]); if(v[6]==a) swap(v[4], v[6]); a=getMedian(v[4], v[5], v[6]); if(v[6]==a) swap(v[5], v[6]); int p=1; for(int i=4; i<=6; i++) { int cara=getNextLightest(v[1], v[2], v[3], v[i]); while(v[p]!=cara) resp.push_back(v[p++]); resp.push_back(v[i]); } while(p!=4) resp.push_back(v[p++]); for(int i=0; i<6; i++) respf[i]=resp[i]; answer(respf); }

Compilation message (stderr)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void orderCoins()':
scales.cpp:15:12: warning: unused variable 'b' [-Wunused-variable]
     int a, b;
            ^
#Verdict Execution timeMemoryGrader output
Fetching results...