Submission #282617

#TimeUsernameProblemLanguageResultExecution timeMemory
282617SamAndScales (IOI15_scales)C++17
55.56 / 100
1 ms384 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define m_p make_pair #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()) typedef long long ll; void init(int T) { } vector<int> ans; void ave(int i, int x) { vector<int> yans; for (int j = 0; j < i; ++j) yans.push_back(ans[j]); yans.push_back(x); for (int j = i; j < sz(ans); ++j) yans.push_back(ans[j]); ans = yans; } void orderCoins() { /*freopen("input.txt", "w", stdout); printf("720\n"); int t[6] = {1, 2, 3, 4, 5, 6}; do { for (int i = 0; i < 6; ++i) printf("%d ", t[i]); printf("\n"); } while (next_permutation(t, t + 6)); exit(0);*/ ans.clear(); ans.push_back(getLightest(1, 2, 3)); ans.push_back(getMedian(1, 2, 3)); ans.push_back(1 + 2 + 3 - ans[0] - ans[1]); int u = getNextLightest(ans[0], ans[1], ans[2], 4); if (u == ans[0]) { if (getLightest(ans[0], ans[1], 4) == 4) ave(0, 4); else ave(3, 4); } else { if (u == ans[1]) { ave(1, 4); } else if (u == ans[2]) { ave(2, 4); } } u = getNextLightest(ans[0], ans[1], ans[3], 5); if (u == ans[0]) { if (getLightest(ans[0], ans[1], 5) == 5) ave(0, 5); else ave(4, 5); } else { if (u == ans[1]) ave(1, 5); else if (u == ans[3]) { if (getMedian(ans[0], ans[2], 5) == 5) ave(2, 5); else ave(3, 5); } } u = getNextLightest(ans[0], ans[2], ans[4], 6); if (u == ans[0]) { if (getLightest(ans[0], ans[1], 6) == 6) ave(0, 6); else ave(5, 6); } else { if (u == ans[2]) { if (getMedian(ans[0], ans[1], 6) == 6) ave(1, 6); else ave(2, 6); } else if (u == ans[4]) { if (getMedian(ans[0], ans[3], 6) == 6) ave(3, 6); else ave(4, 6); } } int W[] = {ans[0], ans[1], ans[2], ans[3], ans[4], ans[5]}; answer(W); }

Compilation message (stderr)

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