제출 #723565

#제출 시각아이디문제언어결과실행 시간메모리
723565mhabibov순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; vector<int> construct_permutation(int k){ vector<int> permutation; for(int i = k-2; i>=0; i--){ permutation.push_back(i); } return permutation; } int main(){ vector<int> p = construct_permutation(3); for(int i = 0; i < p.size(); i++){ cout << p[i] << " "; } }

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

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