Submission #617937

#TimeUsernameProblemLanguageResultExecution timeMemory
617937blueScales (IOI15_scales)C++17
26.32 / 100
1 ms340 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; using vi = vector<int>; using vvi = vector<vi>; #define sz(x) int(x.size()) void init(int T) { /* ... */ } int L; int cmp(int a, int b) { if(a == 0) return 0; if(b == 0) return 1; if(getHeaviest(L, a, b) == b) return 1; else return 0; } void orderCoins() { int l1 = getLightest(1, 2, 3); int l2 = getLightest(4, 5, 6); int k = 1; while(k == l1 || k == l2) k++; L = getLightest(l1, l2, k); vi res{L}; vi used(7, 0); used[L] = 1; for(int t = 1; t <= 5; t++) { int c = 0; for(int i = 1; i <= 6; i++) { if(used[i]) continue; if(cmp(i, c)) c = i; } used[c] = 1; res.push_back(c); } int W[] = {res[0], res[1], res[2], res[3], res[4], res[5], res[6]}; answer(W); }

Compilation message (stderr)

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