Submission #741800

#TimeUsernameProblemLanguageResultExecution timeMemory
741800TrunktyScales (IOI15_scales)C++14
38.46 / 100
1 ms308 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; //#define int ll #include "scales.h" void init(int t){} int ans[6]; void orderCoins(){ int a1,a2,a3,b1,b2,b3; a1 = getLightest(1,2,3); a3 = getHeaviest(1,2,3); a2 = 6-a1-a3; b1 = getLightest(4,5,6); b3 = getHeaviest(4,5,6); b2 = 15-b1-b3; int x = getNextLightest(a1,a2,a3,b1); if(x==a1){ x = getHeaviest(a1,a2,b1); if(x==a2){ x = a1; } } int y = getNextLightest(a1,a2,a3,b2); if(y==a1){ y = getHeaviest(a1,a2,b2); if(y==a2){ y = a1; } } int z = getNextLightest(a1,a2,a3,b3); if(z==a1){ z = getHeaviest(a1,a2,b3); if(z==a2){ z = a1; } } vector<int> v; if(x==a1){ v.push_back(b1); } if(y==a1){ v.push_back(b2); } if(z==a1){ v.push_back(b3); } v.push_back(a1); if(x==a2){ v.push_back(b1); } if(y==a2){ v.push_back(b2); } if(z==a2){ v.push_back(b3); } v.push_back(a2); if(x==a3){ v.push_back(b1); } if(y==a3){ v.push_back(b2); } if(z==a3){ v.push_back(b3); } v.push_back(a3); if(x==b1){ v.push_back(b1); } if(y==b2){ v.push_back(b2); } if(z==b3){ v.push_back(b3); } for(int i=0;i<v.size();i++){ ans[i] = v[i]; } answer(ans); }

Compilation message (stderr)

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