제출 #164199

#제출 시각아이디문제언어결과실행 시간메모리
164199dantoh000곤돌라 (IOI14_gondola)C++14
컴파일 에러
0 ms0 KiB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;

int valid(int n, int inputSeq[]) {
    int anchor[n];
    unordered_set<int> s;
    int last = -1;
    for (int i = 0; i < n; i++){
        s.insert(inputSeq[i]);
        if (inputSeq[i] > n) continue;
        anchor[i] = (i+n-inputSeq[i])%n;
        printf("%d ",anchor[i]);
        if (last == -1){
            last = anchor[i];
        }
        else{
            if (last != anchor[i]) return 0;
        }
    }
    if (s.size() != n) return 0;
    return 1;
}

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

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:21:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (s.size() != n) return 0;
         ~~~~~~~~~^~~~
/tmp/cchON9LX.o: In function `main':
grader.cpp:(.text.startup+0xc3): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0x106): undefined reference to `replacement'
collect2: error: ld returned 1 exit status