Submission #1103933

#TimeUsernameProblemLanguageResultExecution timeMemory
1103933ezzzayToys (CEOI18_toy)C++14
0 / 100
1 ms336 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back int m,n; vector<int>vc; vector<int>st; void fun(int x, int p, int k){ if(x==1){ st.pb(k); return; } for(int i=p;i<vc.size();i++){ if(x%vc[i]==0){ fun(x/vc[i],i,k+vc[i]-1); } } } signed main(){ cin>>n; set<int>ts; for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ ts.insert(i); ts.insert(n/i); } } for(auto a:ts)vc.pb(a); fun(n,0,0); st.pb(n-1); cout<<st.size()<<endl; for(auto a:st)cout<<a<<" "; }

Compilation message (stderr)

toy.cpp: In function 'void fun(long long int, long long int, long long int)':
toy.cpp:15:18: 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]
   15 |     for(int i=p;i<vc.size();i++){
      |                 ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...