Submission #133795

#TimeUsernameProblemLanguageResultExecution timeMemory
133795Runtime_error_Scales (IOI15_scales)C++14
19.53 / 100
2 ms504 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; int mn = 1; void init(int T) { } bool cmp(int x,int y){ int tmp = getHeaviest(mn,x,y); return (tmp == y); } void orderCoins() { int W[] = {1, 2, 3, 4, 5, 6}; int x = getLightest(1,2,3) , y = getLightest(4,5,6),z; for(int i=1;i<=6;i++) if(i != x && i != y) z = i; mn = getLightest( x,y,z ); for(int i=1;i<6;i++) if(W[i] == mn) swap(W[i],W[0]); sort(W+1,W+6,cmp); answer(W); return ; }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:6:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:23:21: warning: 'z' may be used uninitialized in this function [-Wmaybe-uninitialized]
     mn = getLightest( x,y,z );
          ~~~~~~~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...