제출 #524769

#제출 시각아이디문제언어결과실행 시간메모리
524769obokamanThe Big Prize (IOI17_prize)C++17
컴파일 에러
0 ms0 KiB
#include <iostream>

using namespace std;

int[] ask(int i);

int find_best(int n) {
  for (int i = 0; i < n; ++i) {
    auto ans = ask(i);
    if (ans[0]==0 && ans[1]==0) {
      return i;
    }
  }
  return -1;
}

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

prize.cpp:5:4: error: structured binding declaration cannot have type 'int'
    5 | int[] ask(int i);
      |    ^~
prize.cpp:5:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
prize.cpp:5:4: error: empty structured binding declaration
prize.cpp:5:7: error: expected initializer before 'ask'
    5 | int[] ask(int i);
      |       ^~~
prize.cpp: In function 'int find_best(int)':
prize.cpp:9:16: error: 'ask' was not declared in this scope
    9 |     auto ans = ask(i);
      |                ^~~