제출 #60786

#제출 시각아이디문제언어결과실행 시간메모리
60786Flugan42저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef long double lld;
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define per(i,a,b) for(ll i = a; i >= b; i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll)(x).size()
#define trav(a,x) for(auto a : x)
#define inf 1000000000000000000

void init(int T) {

}

void orderCoins() {
    int W[] = {1, 2, 3, 4, 5, 6};
    int A[3],B[3];
    A[0] = getLightest(1,2,3);
    A[1] = getMedian(1,2,3);
    A[2] = 6-A[0]-A[1];
    B[0] = getLightest(4,5,6);
    B[1] = getMedian(4,5,6);
    B[2] = 15-B[0]-B[1];
    ll a[3];
    rep(i,0,3) a[i] = getNextLightest(A[0],A[1],A[2],B[i]);
    if (a[0] == A[0] && a[1] == A[0] && a[2] == A[0]){
      ll b = getLightest(A[0],A[1],B[1]);
      if (b == B[1]){
        W[0] = B[0]; W[1] = B[1];
        ll c = getLightest(A[0],A[1],B[2]);
        if (c == B[2]){
          W[3] = A[0]; W[4] = A[1]; W[5] = A[2]; W[2] = B[2];
        } else {
          W[2] = A[0]; W[3] = A[1]; W[4] = A[2]; W[5] = B[2];
        }
      } else {
        ll c = getLightest(A[0],A[1],B[0]);
        if (c == B[0]){
          W[0] = B[0]; W[1] = A[0]; W[2] = A[1]; W[3] = A[2]; W[4] = B[1]; W[5] = B[2];
        } else {
          W[3] = B[0]; W[0] = A[0]; W[1] = A[1]; W[2] = A[2]; W[4] = B[1]; W[5] = B[2];
        }
      }
    } else {
      vector<vi> befA;
      vi _; befA.assign(4,_);
      bool check = true;
      rep(i,0,3){
        rep(j,0,3){
          if (a[i] == A[j]){
            if (j == 0 && check){
              befA[j].push_back(B[i]);
            } else if (j == 0) {
              befA[3].push_back(B[i]);
            } else {
              befA[j].push_back(B[i]);
            }
          }
        }
      }
      ll cur = 0;
      rep(i,0,4){
        trav(j:befA[i]){
          W[cur] = j; cur++;
        }
        if (i < 3) { W[cur] = A[i]; cur++; }
      }
    }
    answer(W);
}

컴파일 시 표준 에러 (stderr) 메시지

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp:67:23: error: macro "trav" requires 2 arguments, but only 1 given
         trav(j:befA[i]){
                       ^
scales.cpp: In function 'void init(int)':
scales.cpp:15:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:22:12: error: 'getLightest' was not declared in this scope
     A[0] = getLightest(1,2,3);
            ^~~~~~~~~~~
scales.cpp:22:12: note: suggested alternative: 'gettext'
     A[0] = getLightest(1,2,3);
            ^~~~~~~~~~~
            gettext
scales.cpp:23:12: error: 'getMedian' was not declared in this scope
     A[1] = getMedian(1,2,3);
            ^~~~~~~~~
scales.cpp:23:12: note: suggested alternative: 'getdelim'
     A[1] = getMedian(1,2,3);
            ^~~~~~~~~
            getdelim
scales.cpp:29:23: error: 'getNextLightest' was not declared in this scope
     rep(i,0,3) a[i] = getNextLightest(A[0],A[1],A[2],B[i]);
                       ^~~~~~~~~~~~~~~
scales.cpp:67:9: error: 'trav' was not declared in this scope
         trav(j:befA[i]){
         ^~~~
scales.cpp:67:9: note: suggested alternative: 'tan'
         trav(j:befA[i]){
         ^~~~
         tan
scales.cpp:73:5: error: 'answer' was not declared in this scope
     answer(W);
     ^~~~~~
scales.cpp:73:5: note: suggested alternative: 'assert'
     answer(W);
     ^~~~~~
     assert