Submission #765651

#TimeUsernameProblemLanguageResultExecution timeMemory
765651boyliguanhanScales (IOI15_scales)C++17
55.56 / 100
1 ms244 KiB
#include "scales.h" #define x(a,b,c) if(a==c) swap(b,c); void init(int T) {} void swap(int &a, int &b) { a+=b; b=a-b; a-=b; } void orderCoins(){ int a=getLightest(1,2,3); int f=getHeaviest(4,5,6); int b=1+(a==1),c=2+(a<=2); int d=4+(f==4),e=5+(f<=5); int a2=getLightest(a,d,e); x(a2,a,d) x(a2,a,e) int f2=getHeaviest(f,b,c); x(f2,f,b) x(f2,f,c) int b2=getLightest(b,c,d); x(b2,b,c) x(b2,b,d) x(getLightest(b,d,e),b,e) int e2=getHeaviest(c,d,e); x(e2,e,c) x(e2,e,d); x(getLightest(c,d,e),c,d); int w[]={a,b,c,d,e,f}; answer(w); }

Compilation message (stderr)

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