Submission #959327

#TimeUsernameProblemLanguageResultExecution timeMemory
959327zeta7532Permutation (APIO22_perm)C++17
91.33 / 100
2 ms588 KiB
#include "perm.h" #include <bits/stdc++.h> #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; using ll = long long; const ll mod = 998244353; #define fi first #define se second #define rep(i,n) for(ll i=0;i<n;i++) #define all(x) x.begin(),x.end() #define faster ios::sync_with_stdio(false);cin.tie(nullptr) std::vector<int> construct_permutation(long long k) { if(k==2) return {0}; if(k%2==0){ vector<int> A=construct_permutation(k/2); A.push_back(A.size()); return A; } if(k%2==1){ vector<int> A=construct_permutation(k-1); rep(i,A.size()) A[i]++; A.push_back(0); return A; } }

Compilation message (stderr)

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:11:30: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define rep(i,n) for(ll i=0;i<n;i++)
......
   25 |      rep(i,A.size()) A[i]++;
      |          ~~~~~~~~~~           
perm.cpp:25:6: note: in expansion of macro 'rep'
   25 |      rep(i,A.size()) A[i]++;
      |      ^~~
perm.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...