제출 #387819

#제출 시각아이디문제언어결과실행 시간메모리
387819MilosMilutinovicGondola (IOI14_gondola)C++14
컴파일 에러
0 ms0 KiB
/** * author: milos * created: 09.04.2021 10:49:32 **/ #include <bits/stdc++.h> using namespace std; int valid(int n, vector<int> a) { set<int> s(a.begin(), a.end()); for (int i = 0; i < n; i++) { a[i] %= n; if (a[i] == 0) { a[i] = n; } } if (s.size() != n) { return 0; } int cnt = 0; for (int i = 1; i < n; i++) { if (a[i] < a[i - 1]) { cnt++; } } return (cnt <= 1 ? 1 : 0); }

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

gondola.cpp: In function 'int valid(int, std::vector<int>)':
gondola.cpp:17:16: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |   if (s.size() != n) {
      |       ~~~~~~~~~^~~~
/tmp/ccgZJrfw.o: In function `main':
grader.cpp:(.text.startup+0xb6): undefined reference to `valid'
grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status