Submission #596948

#TimeUsernameProblemLanguageResultExecution timeMemory
596948PiejanVDCScales (IOI15_scales)C++17
38.46 / 100
1 ms212 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int t) { } void orderCoins() { int vis[7][7][7]; for(int i = 1 ; i <= 6 ; i++) for(int j = 1 ; j <= 6 ; j++) for(int k = 1 ; k <= 6 ; k++) vis[i][j][k] = 0; int a; int ans[6] = {1, 2, 3, 4, 5, 6}; for(int t = 0 ; t < 2 ; t++) { for(int i = 0 ; i < 4 ; i++) { if(vis[ans[i]][ans[i+1]][ans[i+2]]) a = vis[ans[i]][ans[i+1]][ans[i+2]]; else a = vis[ans[i]][ans[i+1]][ans[i+2]] = getLightest(ans[i], ans[i+1], ans[i+2]); if(ans[i+1] == a) swap(ans[i], ans[i+1]); if(ans[i+2] == a) swap(ans[i], ans[i+2]); } } int i = 0; if(vis[ans[i]][ans[i+1]][ans[i+2]]) a = vis[ans[i]][ans[i+1]][ans[i+2]]; else a = vis[ans[i]][ans[i+1]][ans[i+2]] = getLightest(ans[i], ans[i+1], ans[i+2]); if(ans[i+1] == a) swap(ans[i], ans[i+1]); if(ans[i+2] == a) swap(ans[i], ans[i+2]); int b = getHeaviest(ans[3], ans[4], ans[5]); if(ans[3] == b) swap(ans[3], ans[5]); if(ans[4] == b) swap(ans[4], ans[5]); answer(ans); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 't' [-Wunused-parameter]
    5 | void init(int t) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...