Submission #723565

#TimeUsernameProblemLanguageResultExecution timeMemory
723565mhabibovPermutation (APIO22_perm)C++17
Compilation error
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] << " "; } }

Compilation message (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