제출 #746970

#제출 시각아이디문제언어결과실행 시간메모리
746970snpmrnhlol순열 (APIO22_perm)C++17
91.33 / 100
3 ms428 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector <int> v; map <ll,ll> f; std::vector<int> construct_permutation(ll k) { v.clear(); ll i,j,cnt = 0; i = j = 0; while(k > 1){ if(k%2 == 1){ v.push_back(1000 - j++); } v.push_back(i++); k/=2; } f.clear(); ll cnt2 = 0; //for(auto i:v)cout<<i<<' '; for(auto i:v)f[i] = 1; for(auto &i:f)i.second = cnt2++;//,cout<<i.first<<' '; for(auto &i:v)i = f[i]; //for(auto i:v)cout<<i<<' '; return v; }

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

perm.cpp: In function 'std::vector<int> construct_permutation(ll)':
perm.cpp:10:12: warning: unused variable 'cnt' [-Wunused-variable]
   10 |     ll i,j,cnt = 0;
      |            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...