Submission #485438

#TimeUsernameProblemLanguageResultExecution timeMemory
485438AmirElarbiScales (IOI15_scales)C++14
0 / 100
1 ms460 KiB
#include <bits/stdc++.h> #include "scales.h" #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define fi first #define se second #define INF 1e9 #define eps 1e-7 #define eps1 1e-25 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 1e5+5 #define V 450 using namespace std; const int MOD = 1e9+7; const int nax = 200005; void init(int T) { return; } void orderCoins() { int i = 1, j = 2, k = 3; int light = getLightest(i,j,k), hev = getHeaviest(i,j,k); light = getLightest(light,4,5), hev = getHeaviest(hev,4,5); if(light!=4) light = getLightest(light,4,6); else light = getLightest(light,5,6); if(hev!=4) hev = getHeaviest(hev,4,6); else hev = getHeaviest(hev,5,6); int w[6]; w[0] = light; bool a[6]; a[light-1] = 1; vi s; for(int i = 0; i < 6; i++){ if(!a[i]){s.pb(i+1);} } int res = getNextLightest(s[0],s[1],s[2],light); w[1] = light = getLightest(res,s[3],s[4]); a[light-1] = true; s.clear(); for(int i = 0; i < 6; i++){ if(!a[i]){s.pb(i+1);} } res = getNextLightest(s[0],s[1],s[2],light); w[2] = light = getMedian(res,s[3],w[1]); a[light-1] = true; s.clear(); for(int i = 0; i < 6; i++){ if(!a[i]){s.pb(i+1);} } w[3] = light = getNextLightest(s[0],s[1],s[2],light); a[light-1] = true; w[5] = hev; for(int i = 0; i < 6; i++){ if(!a[i]){w[4] = i; break;} } answer(w); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:24:15: warning: unused parameter 'T' [-Wunused-parameter]
   24 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:45:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   45 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
scales.cpp:52:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   52 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
scales.cpp:59:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   59 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
scales.cpp:65:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   65 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...