제출 #671079

#제출 시각아이디문제언어결과실행 시간메모리
671079AdamGS순열 (APIO22_perm)C++17
91.33 / 100
3 ms340 KiB
#include "perm.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() vector<int>construct_permutation(ll k) { vector<int>ans; if(k==1) return ans; if(k%2==1) { ans=construct_permutation(k-1); reverse(all(ans)); ans.pb(ans.size()); reverse(all(ans)); return ans; } ans=construct_permutation(k/2); rep(i, ans.size()) ++ans[i]; reverse(all(ans)); ans.pb(0); reverse(all(ans)); return ans; }

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

perm.cpp: In function 'std::vector<int> construct_permutation(ll)':
perm.cpp:6:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
perm.cpp:22:9: note: in expansion of macro 'rep'
   22 |         rep(i, ans.size()) ++ans[i];
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...