Submission #975946

#TimeUsernameProblemLanguageResultExecution timeMemory
975946OrifkhonPermutation (APIO22_perm)C++17
Compilation error
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] << ' '; } }

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