Submission #1106014

#TimeUsernameProblemLanguageResultExecution timeMemory
1106014groshiPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "perm.h" #define int long long using namespace std; vector<int> szukaj(int x) { if(x<=1) return {}; if(x==2) return {0}; for(int i=3;i<=7;i+=2) { if(x%i==0 && x!=i) { vector<int> mam1=szukaj(i); vector<int> mam2=szukaj(x/i); for(int i=0;i<mam2.size();i++) mam1.push_back(mam2[i]+mam1.size()); return mam1; } } vector<int> mam=szukaj(x/2); mam.push_back(mam.size()); if(x%2==1) mam.insert(mam.begin(),mam.size()); return mam; } vector<int32_t> construct_permutation(int32_t x) { return szukaj(x); }

Compilation message (stderr)

perm.cpp: In function 'std::vector<long long int> szukaj(long long int)':
perm.cpp:17:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             for(int i=0;i<mam2.size();i++)
      |                         ~^~~~~~~~~~~~
perm.cpp: In function 'std::vector<int> construct_permutation(int32_t)':
perm.cpp:30:18: error: could not convert 'szukaj(long long int)()' from 'vector<long long int>' to 'vector<int>'
   30 |     return szukaj(x);
      |            ~~~~~~^~~
      |                  |
      |                  vector<long long int>