제출 #1106017

#제출 시각아이디문제언어결과실행 시간메모리
1106017groshi순열 (APIO22_perm)C++17
100 / 100
2 ms592 KiB
#include<bits/stdc++.h> #include "perm.h" #define int long long using namespace std; vector<int32_t> szukaj(long long x) { if(x<=1) return {}; if(x==2) return {0}; for(long long i=3;i<=7;i+=2) { if(x%i==0 && x!=i) { vector<int32_t> mam1=szukaj(i); vector<int32_t> mam2=szukaj(x/i); for(int i=0;i<mam2.size();i++) mam1.push_back(mam2[i]+mam1.size()-i); return mam1; } } vector<int32_t> mam=szukaj(x/2); mam.push_back(mam.size()); if(x%2==1) mam.insert(mam.begin(),mam.size()); //cout<<x<<": "; //for(int i=0;i<mam.size();i++) //cout<<mam[i]<<" "; //cout<<"\n"; return mam; } vector<int32_t> construct_permutation(long long x) { return szukaj(x); }

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

perm.cpp: In function 'std::vector<int> szukaj(long long int)':
perm.cpp:17:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             for(int i=0;i<mam2.size();i++)
      |                         ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...