Submission #1038591

#TimeUsernameProblemLanguageResultExecution timeMemory
1038591HappyCapybaraScales (IOI15_scales)C++17
45.45 / 100
1 ms436 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; void init(int T){ return; } void orderCoins(){ int W[6]; vector<int> a(3), b(3); a[0] = getLightest(1, 2, 3); a[1] = getMedian(1, 2, 3); a[2] = 6-a[0]-a[1]; b[0] = getLightest(4, 5, 6); b[1] = getMedian(4, 5, 6); b[2] = 15-b[0]-b[1]; int l = 0, r = 0; int cur = 0; while (l < 3 && r < 3){ if (l < 2) W[cur] = getLightest(a[l], b[r], a[2]); else if (r < 2) W[cur] = getLightest(a[l], b[r], b[2]); else { W[5] = getHeaviest(a[l], b[r], a[0]); W[4] = 21-(W[0]+W[1]+W[2]+W[3]+W[5]); answer(W); return; } if (W[cur] == a[l]) l++; else r++; cur++; } while (cur < 6){ if (l < 3) W[cur] = a[l]; else W[cur] = b[r]; cur++; l++; r++; } answer(W); return; }

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...