Submission #1103933

# Submission time Handle Problem Language Result Execution time Memory
1103933 2024-10-22T09:35:58 Z ezzzay Toys (CEOI18_toy) C++14
0 / 100
1 ms 336 KB
#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

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 time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -