Submission #398282

#TimeUsernameProblemLanguageResultExecution timeMemory
398282MeGustaElArroz23Scales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; void init(int T) { return; } int c; //getHeaviest(A, B, C), getLightest(A, B, C), getMedian(A, B, C) int menor(int a, int b){ if (a==c) return true; if (b==c) return false; return (getMedian(a,b,c)==a; } void orderCoins() { int W[]={1,2,3,4,5,6}; int a=getLightest(1,2,3); int b=getLightest(4,5,6); c=a+1; if (c==b) c++; c=getLightest(a,b,c); sort(W.begin(),W.end(),menor); answer(W); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:8:15: warning: unused parameter 'T' [-Wunused-parameter]
    8 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'int menor(int, int)':
scales.cpp:18:32: error: expected ')' before ';' token
   18 |     return (getMedian(a,b,c)==a;
      |            ~                   ^
      |                                )
scales.cpp: In function 'void orderCoins()':
scales.cpp:29:12: error: request for member 'begin' in 'W', which is of non-class type 'int [6]'
   29 |     sort(W.begin(),W.end(),menor);
      |            ^~~~~
scales.cpp:29:22: error: request for member 'end' in 'W', which is of non-class type 'int [6]'
   29 |     sort(W.begin(),W.end(),menor);
      |                      ^~~