제출 #705259

#제출 시각아이디문제언어결과실행 시간메모리
705259veehz순열 (APIO22_perm)C++17
91.33 / 100
2 ms340 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> construct_permutation(ll k){ vector<int> pow; for(int i=0;i<62;i++){ if(k&(1LL<<i)){ pow.push_back(i); } } // cout << "POW" << endl; // for(int i=0;i<pow.size();i++){ // cout << pow[i] << " "; // } // cout << endl; vector<int> ans; int nxtIdx = 0; int nxtNum = pow.back() + pow.size() - 2; for(int i=0;i<pow.back();i++){ if(nxtIdx < pow.size() && i == pow[nxtIdx]){ ans.push_back(nxtNum); nxtNum--; nxtIdx++; } ans.push_back(i); } // print // for(int i=0;i<ans.size();i++){ // cout << ans[i] << " "; // } return ans; }

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

perm.cpp: In function 'std::vector<int> construct_permutation(ll)':
perm.cpp:24:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   if(nxtIdx < pow.size() && i == pow[nxtIdx]){
      |      ~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...