제출 #1135681

#제출 시각아이디문제언어결과실행 시간메모리
1135681Ak_16Gondola (IOI14_gondola)C++20
컴파일 에러
0 ms0 KiB
#include <iostream> #include "gondola.h" using namespace std; int b[300005]; int valid(n, a){ int cnt=0; int sp; for(int i=0; i<n; i++){ if(a[i]<=n){cnt++; sp = i;} } if(cnt==0){return 1;} else { for(int i=0; i<n; i++){ a[(n+a[sp]-sp+i-1)%n] = b[i]; } int bru=0; for(int i=0; i<n; i++){ if(b[i]<=n&&b[i]!=i+1){bru=1;} } return (1-bru); } } int replacement(n, c, d){ } countReplacement(n, e){ }

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

gondola.cpp:9:11: error: 'int valid' redeclared as different kind of entity
    9 | int valid(n, a){
      |           ^
In file included from gondola.cpp:2:
gondola.h:8:5: note: previous declaration 'int valid(int, int*)'
    8 | int valid(int n, int inputSeq[]);
      |     ^~~~~
gondola.cpp:9:11: error: 'n' was not declared in this scope
    9 | int valid(n, a){
      |           ^
gondola.cpp:9:14: error: 'a' was not declared in this scope
    9 | int valid(n, a){
      |              ^
gondola.cpp:33:17: error: 'int replacement' redeclared as different kind of entity
   33 | int replacement(n, c, d){
      |                 ^
In file included from gondola.cpp:2:
gondola.h:10:5: note: previous declaration 'int replacement(int, int*, int*)'
   10 | int replacement(int n, int gondolaSeq[], int replacementSeq[]);
      |     ^~~~~~~~~~~
gondola.cpp:33:17: error: 'n' was not declared in this scope
   33 | int replacement(n, c, d){
      |                 ^
gondola.cpp:33:20: error: 'c' was not declared in this scope
   33 | int replacement(n, c, d){
      |                    ^
gondola.cpp:33:23: error: 'd' was not declared in this scope
   33 | int replacement(n, c, d){
      |                       ^
gondola.cpp:37:17: error: expected constructor, destructor, or type conversion before '(' token
   37 | countReplacement(n, e){
      |                 ^