Submission #132418

# Submission time Handle Problem Language Result Execution time Memory
132418 2019-07-18T19:47:40 Z reda Scales (IOI15_scales) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "scales.h"
using namespace std;
void init(int T) {
    return;
}
bool cmp(int x,int y)
{
    for(int i=1;i<=3;i++)
        {
        if(x==i||y==i)continue;
            int ans=getLightest(x,y,i);
            if(ans==i) ans=getHeaviest(x,y,i),return (ans==y);
            else return (ans==x);
        }
}
void orderCoins() 
{
    int w[6]={1,2,3,4,5,6};
    sort(w,w+6,cmp);
    answer(w);
    return;
}

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:4:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'bool cmp(int, int)':
scales.cpp:13:47: error: expected primary-expression before 'return'
             if(ans==i) ans=getHeaviest(x,y,i),return (ans==y);
                                               ^~~~~~
scales.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^