Submission #1086797

#TimeUsernameProblemLanguageResultExecution timeMemory
1086797PacybwoahScales (IOI15_scales)C++17
55.90 / 100
1 ms600 KiB
#include "scales.h" #include<iostream> #include<vector> #include<algorithm> using namespace std; void init(int T) { /* ... */ } void orderCoins() { /* ... */ vector<int> vec; int a = getMedian(1, 2, 3), b = getLightest(1, 2, 3); vector<bool> vis(7); vis[a] = 1; vis[b] = 1; vec.push_back(b); vec.push_back(a); for(int i = 1; i <= 3; i++) if(vis[i] == 0) vec.push_back(i); a = getMedian(vec[0], vec[1], 4); if(a == vec[0]) vec.insert(vec.begin(), 4); else if(a == 4) vec.insert(vec.begin() + 1, 4); else{ a = getMedian(vec[1], vec[2], 4); if(a == 4) vec.insert(vec.begin() + 2, 4); else vec.insert(vec.begin() + 3, 4); } a = getMedian(vec[0], vec[1], 5); if(a == vec[0]) vec.insert(vec.begin(), 5); else if(a == 5) vec.insert(vec.begin() + 1, 5); else{ a = getMedian(vec[2], vec[3], 5); if(a == vec[2]) vec.insert(vec.begin() + 2, 5); else if(a == 5) vec.insert(vec.begin() + 3, 5); else vec.insert(vec.begin() + 4, 5); } a = getMedian(vec[1], vec[2], 6); if(a == 6){ vec.insert(vec.begin() + 2, 6); } else if(a == vec[1]){ a = getMedian(vec[0], vec[1], 6); if(a == vec[0]) vec.insert(vec.begin(), 6); else vec.insert(vec.begin() + 1, 6); } else{ a = getMedian(vec[3], vec[4], 6); if(a == vec[3]) vec.insert(vec.begin() + 3, 6); else if(a == 6) vec.insert(vec.begin() + 4, 6); else vec.insert(vec.begin() + 5, 6); } int ans[6]; for(int i = 0; i < 6; i++) ans[i] = vec[i]; answer(ans); } // g++ -std=c++17 -o run -Wshadow -Wall -Wextra -fsanitize=undefined -fsanitize=address scales.cpp grader.cpp

Compilation message (stderr)

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