Submission #268594

#TimeUsernameProblemLanguageResultExecution timeMemory
268594A02Scales (IOI15_scales)C++14
0 / 100
2 ms512 KiB
#include "scales.h" #include <vector> #include <set> #include <algorithm> #include <utility> #include <iostream> using namespace std; void init(int T) { /* ... */ return; } void erasev(vector<int> &a, int b){ for (int i = 0; i < a.size(); i++){ if (a[i] == b){ a.erase(a.begin() + i); } } } void orderCoins() { /* ... */ int W[] = {1, 2, 3, 4, 5, 6}; int l1 = getLightest(1, 2, 3); int l2 = getLightest(4, 5, 6); int s = 1; if (1 == l1){ s = 2; } int l = getLightest(l1, l2, s); vector<int> remaining; for (int i = 1; i <= 6; i++){ if (i != l){ remaining.push_back(i); } } l1 = getNextLightest(remaining[0], remaining[1], remaining[2], l); l2 = getNextLightest(remaining[4], remaining[3], l1, l); W[0] = l; W[1] = l2; erasev(remaining, l2); int l3 = getNextLightest(remaining[0], remaining[1], remaining[2], l2); int l4 = getNextLightest(remaining[3], l, l3, l2); W[2] = l4; erasev(remaining, l4); int l5 = getNextLightest(remaining[0], remaining[1], remaining[2], l3); W[3] = l5; W[4] = getMedian(remaining[0], remaining[1], remaining[2]); erasev(remaining, W[3]); erasev(remaining, W[4]); W[5] = remaining[0]; answer(W); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:10:15: warning: unused parameter 'T' [-Wunused-parameter]
   10 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void erasev(std::vector<int>&, int)':
scales.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i = 0; i < a.size(); i++){
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...