제출 #745526

#제출 시각아이디문제언어결과실행 시간메모리
745526mohav48173순열 (APIO22_perm)C++17
0 / 100
1 ms212 KiB
#include<bits/stdc++.h> using namespace std; vector<int> construct_permutation(long long k) { deque<int>ans; vector<bool>bits; while(k>0) { if(k%2)bits.push_back(1); else bits.push_back(0); k/=2; } reverse(bits.begin(),bits.end()); int cur=0; for(int i=0;i<bits.size();i++) { ans.push_back(cur++); if(bits[i])ans.push_front(cur++); } vector<int>anss; for(int i:ans)anss.push_back(i); return anss; }

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

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i=0;i<bits.size();i++) {
      |                 ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...