Submission #47626

#TimeUsernameProblemLanguageResultExecution timeMemory
47626RezwanArefin01Scales (IOI15_scales)C++11
0 / 100
2 ms1080 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) {} void orderCoins() { int w[6] = {-1, -1, -1, -1, -1, -1}; deque<int> f = { getLightest(1, 2, 3), 0, getHeaviest(1, 2, 3) }; f[1] = f[0] ^ f[2]; deque<int> s = { getLightest(4, 5, 6), 0, getHeaviest(4, 5, 6) }; s[1] = (3 + ((s[0] - 3) ^ (s[2] - 3))); w[0] = getLightest(s[0], f[0], s[1]); w[5] = getHeaviest(s[2], f[2], f[1]); if(w[0] == f[0]) f.pop_front(); if(w[0] == s[0]) s.pop_front(); if(w[5] == f[2]) f.pop_back(); if(w[5] == s[2]) s.pop_back(); if(f.size() == s.size()) { w[1] = getLightest(f[0], f[1], s[0]); if(w[1] == f[0]) { int x = getMedian(f[1], s[0], s[1]); if(x == f[1]) { w[2] = s[0], w[3] = f[1], w[4] = s[1]; } else if (x == s[0]) { w[2] = f[1], w[3] = s[0], w[4] = s[1]; } else { w[2] = s[0], w[3] = s[1], w[4] = f[1]; } } else { int x = getMedian(f[0], f[1], s[1]); if(x == f[0]){ w[2] = s[1], w[3] = f[0], w[4] = f[1]; } else if(x == f[1]) { w[2] = f[0], w[3] = f[1], w[4] = s[1]; } else { w[2] = f[0], w[3] = s[1] , w[4] = f[1]; } } } else { if(f.size() < s.size()) { int x = getMedian(f[0], s[0], s[2]); cout << x << endl; if(x == s[0]) { w[1] = f[0], w[2] = s[0], w[3] = s[1], w[4] = s[2]; } else if(x == s[2]) { w[1] = s[0], w[2] = s[1], w[3] = s[2], w[4] = f[0]; } else { w[1] = s[0], w[4] = s[2]; w[3] = getHeaviest(f[0], s[0], s[1]); w[2] = w[3] ^ f[0] ^ s[1]; } } else { int x = getMedian(f[0], f[2], s[0]); if(x == f[0]) { w[1] = s[0], w[2] = f[0], w[3] = f[1], w[4] = f[3]; } else if(x == f[1]) { w[1] = f[0], w[2] = f[1], w[3] = f[2], w[4] = s[0]; } else { w[1] = f[0], w[4] = f[2]; w[3] = getHeaviest(f[0], f[1], s[0]); w[2] = w[3] ^ f[1] ^ s[0]; } } } answer(w); }

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 init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {}
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...