제출 #916386

#제출 시각아이디문제언어결과실행 시간메모리
916386Jakub_Wozniak순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector <int> v; int main() { ios_base::sync_with_stdio(0); cin.tie(0); long long t , n , m , f , xa, ya , xb , yb; cin >> t; while(t--) { cin >> n; long long akt = 200; bool b = 0; while(n) { if(n == 1)break; if(n%2) { v.push_back(0); } v.push_back(akt); n /= 2; akt--; } cout << v.size() << '\n'; for(int i = 0 ; i < v.size() ; i++) { cout << v[v.size()-i-1] << ' '; } cout << '\n'; v.clear(); } return 0; }

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

perm.cpp: In function 'int main()':
perm.cpp:27:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |         for(int i = 0 ; i < v.size() ; i++)
      |                         ~~^~~~~~~~~~
perm.cpp:13:45: warning: unused variable 'b' [-Wunused-variable]
   13 |         cin >> n; long long akt = 200; bool b = 0;
      |                                             ^
perm.cpp:9:23: warning: unused variable 'm' [-Wunused-variable]
    9 |     long long t , n , m , f , xa, ya , xb , yb;
      |                       ^
perm.cpp:9:27: warning: unused variable 'f' [-Wunused-variable]
    9 |     long long t , n , m , f , xa, ya , xb , yb;
      |                           ^
perm.cpp:9:31: warning: unused variable 'xa' [-Wunused-variable]
    9 |     long long t , n , m , f , xa, ya , xb , yb;
      |                               ^~
perm.cpp:9:35: warning: unused variable 'ya' [-Wunused-variable]
    9 |     long long t , n , m , f , xa, ya , xb , yb;
      |                                   ^~
perm.cpp:9:40: warning: unused variable 'xb' [-Wunused-variable]
    9 |     long long t , n , m , f , xa, ya , xb , yb;
      |                                        ^~
perm.cpp:9:45: warning: unused variable 'yb' [-Wunused-variable]
    9 |     long long t , n , m , f , xa, ya , xb , yb;
      |                                             ^~
/usr/bin/ld: /tmp/ccDHxb8u.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccDwLBpt.o:perm.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccDHxb8u.o: in function `main':
grader.cpp:(.text.startup+0x240): undefined reference to `construct_permutation(long long)'
collect2: error: ld returned 1 exit status