Submission #140134

#TimeUsernameProblemLanguageResultExecution timeMemory
140134PedroBigManScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include "scales.h" #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> using namespace std; typedef int ll; typedef unsigned long long int ull; typedef long double ld; #define REP(i,a,b) for(ll i=a; i<b; i++) #define pb push_back #define mp make_pair #define pl pair<ll,ll> #define ff first #define ss second #define INF ((ll) pow(2,63) -1) #define gH getHeaviest #define gL getLightest #define gM getMedian #define gNL getNextLightest ll insig; #define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);} void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;} ll Q; void init(int T) { Q=T; } void orderCoins() { vector<ll> t1, t2; REP(i,0,3) {t1.pb(0); t2.pb(0);} ll q1,q2; q1 = gH(1,2,3); q2 = gL(1,2,3); t1[0]=q2; t1[2]=q1; REP(i,1,4) { if(q1!=i && q2!=i) {t1[1]=i;} } ll q3, q4; q3 = gH(4,5,6); q4 = gL(4,5,6); t2[0]=q4; t2[2]=q3; REP(i,1,4) { if(q3!=i && q4!=i) {t2[1]=i;} } ll q5 = gH(t1[2],t2[1],t2[2]); ll q6, q7,q8; ll ans[6]; REP(i,0,6) {ans.pb(0);} if(q5 == t1[2]) { vector<ll> r1=t1; vector<ll> r2=t2; REP(i,0,3) {t1[i]=r2[i]; t2[i]=r1[i];} ans[5]=t2[2]; q6 = gM(t1[2],t2[0],t2[1]); if(q6==t1[2]) { ans[4]=t2[1]; ans[3]=t1[2]; q7=gM(t1[0],t1[1],t2[0]); if(q7==t1[0]) { ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1]; } else if(q7==t1[1]) { ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0]; } else if(q7==t2[0]) { ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1]; } q8=gM(1,2,3); answer(ans); } else if(q6==t2[0]) { ans[4]=t2[1]; ans[3]=t2[0]; ans[2]=t1[2]; ans[1]=t1[1]; ans[0]=t1[0]; q7 = gM(1,2,3); q8=gM(1,2,3); answer(ans); } else if(q6==t2[1]) { ans[4]=t1[2]; q7=gM(t1[0],t1[1],t2[0]); q8=gM(t1[0],t1[1],t2[1]); if(q7==t1[0] && q8==t1[0]) { ans[0]=t2[0]; ans[1]=t2[1]; ans[2]=t1[0]; ans[3]=t1[1]; } else if(q7==t1[0] && q8==t1[1]) { ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1]; ans[3]=t2[1]; } else if(q7==t1[0] && q8==t2[1]) { ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t2[1]; ans[3]=t1[1]; } else if(q7==t1[1] && q8==t1[1]) { ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0]; ans[3]=t2[1]; } else if(q7==t2[0] && q8==t1[1]) { ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1]; ans[3]=t2[1]; } else if(q7==t2[0] && q8==t2[1]) { ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t2[1]; ans[3]=t1[1]; } answer(ans); } } else if(q5 == t2[2]) { ans[5]=t2[2]; q6 = gM(t1[2],t2[0],t2[1]); if(q6==t1[2]) { ans[4]=t2[1]; ans[3]=t1[2]; q7=gM(t1[0],t1[1],t2[0]); if(q7==t1[0]) { ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1]; } else if(q7==t1[1]) { ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0]; } else if(q7==t2[0]) { ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1]; } q8=gM(1,2,3); answer(ans); } else if(q6==t2[0]) { ans[4]=t2[1]; ans[3]=t2[0]; ans[2]=t1[2]; ans[1]=t1[1]; ans[0]=t1[0]; q7 = gM(1,2,3); q8=gM(1,2,3); answer(ans); } else if(q6==t2[1]) { ans[4]=t1[2]; q7=gM(t1[0],t1[1],t2[0]); q8=gM(t1[0],t1[1],t2[1]); if(q7==t1[0] && q8==t1[0]) { ans[0]=t2[0]; ans[1]=t2[1]; ans[2]=t1[0]; ans[3]=t1[1]; } else if(q7==t1[0] && q8==t1[1]) { ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1]; ans[3]=t2[1]; } else if(q7==t1[0] && q8==t2[1]) { ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t2[1]; ans[3]=t1[1]; } else if(q7==t1[1] && q8==t1[1]) { ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0]; ans[3]=t2[1]; } else if(q7==t2[0] && q8==t1[1]) { ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1]; ans[3]=t2[1]; } else if(q7==t2[0] && q8==t2[1]) { ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t2[1]; ans[3]=t1[1]; } answer(ans); } } return ; }

Compilation message (stderr)

scales.cpp: In function 'void Out(std::vector<int>)':
scales.cpp:11:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,a,b) for(ll i=a; i<b; i++)
scales.cpp:24:29:
 void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
                             ~~~~~~~~~~~~
scales.cpp:24:25: note: in expansion of macro 'REP'
 void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
                         ^~~
scales.cpp: In function 'void orderCoins()':
scales.cpp:12:12: error: request for member 'push_back' in 'ans', which is of non-class type 'll [6] {aka int [6]}'
 #define pb push_back
            ^
scales.cpp:50:32: note: in expansion of macro 'pb'
     ll ans[6]; REP(i,0,6) {ans.pb(0);}
                                ^~