제출 #398282

#제출 시각아이디문제언어결과실행 시간메모리
398282MeGustaElArroz23저울 (IOI15_scales)C++14
컴파일 에러
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); }

컴파일 시 표준 에러 (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);
      |                      ^~~