제출 #744896

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

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

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