제출 #975946

#제출 시각아이디문제언어결과실행 시간메모리
975946Orifkhon순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
// Source: https://usaco.guide/general/io #include <bits/stdc++.h> using namespace std; vector<int> construct_permutation(long long k) { vector<int> arr(k - 1); for(int i = 0; i <= k - 2; i++){ arr[i] = i; } return arr; } int main(){ int k; cin >> k; vector<int> perm = construct_permutation(k); for(int i = 0; i < perm.size(); i++){ cout << perm[i] << ' '; } }

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

perm.cpp: In function 'int main()':
perm.cpp:19:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   for(int i = 0; i < perm.size(); i++){
      |                  ~~^~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccfhg0hZ.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccJYXXDZ.o:perm.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status