Submission #815092

#TimeUsernameProblemLanguageResultExecution timeMemory
815092kwongwengScales (IOI15_scales)C++17
55.56 / 100
1 ms212 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef long double ld; typedef pair<ll, ll> pll; #define FOR(i, a, b) for(int i = a; i < b; i++) #define ROF(i, a, b) for(int i = a; i >= b; i--) #define ms memset #define pb push_back #define fi first #define se second #define H(a,b,c) getHeaviest(a,b,c) #define L(a,b,c) getLightest(a,b,c) #define M(a,b,c) getMedian(a,b,c) #define NL(a,b,c,d) getNextLightest(a,b,c,d); void init(int T) { /* ... */ } void orderCoins() { /* ... */ int mx1 = H(1,2,3); int mn1 = L(1,2,3); int md1 = 6-mx1-mn1; int mx2 = H(4,5,6); int mn2 = L(4,5,6); int md2 = 15-mx2-mn2; vi seq1 = {mn1,md1,mx1}; vi seq2 = {mn2,md2,mx2}; int val = H(mx1,mx2,md1); vi ans; if (val==mx2){ int cur=0; FOR(i,0,3){ int val2 = NL(mn2,md2,mx2,seq1[i]); if (val2==mn2) ans.pb(seq1[i]); if (val2==md2){ if (cur==0){ans.pb(mn2); cur++;} ans.pb(seq1[i]); } if (val2==mx2){ if (cur==0){ans.pb(mn2); cur++;} if (cur==1){ans.pb(md2); cur++;} ans.pb(seq1[i]); } } if (cur==0){ans.pb(mn2); cur++;} if (cur==1){ans.pb(md2); cur++;} ans.pb(mx2); }else{ int cur=0; FOR(i,0,3){ int val2 = NL(mn1,md1,mx1,seq2[i]); if (val2==mn1) ans.pb(seq2[i]); if (val2==md1){ if (cur==0){ans.pb(mn1); cur++;} ans.pb(seq2[i]); } if (val2==mx1){ if (cur==0){ans.pb(mn1); cur++;} if (cur==1){ans.pb(md1); cur++;} ans.pb(seq2[i]); } } if (cur==0){ans.pb(mn1); cur++;} if (cur==1){ans.pb(md1); cur++;} ans.pb(mx1); } int W[] = {1, 2, 3, 4, 5, 6}; FOR(i,0,6) W[i]=ans[i]; answer(W); }

Compilation message (stderr)

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