Submission #523588

# Submission time Handle Problem Language Result Execution time Memory
523588 2022-02-07T21:04:42 Z Deepesson Toys (CEOI18_toy) C++17
19 / 100
5000 ms 464 KB
#include <bits/stdc++.h>
std::vector<long long> divisores;
std::map<int,bool> respostas;
std::map<std::vector<long long>,bool> foi;
void processa(std::vector<long long> tem){
    if(foi[tem])return;
    {
        int s=0;
        for(auto&x:tem)s+=x-1;
        respostas[s]=true;
    }
    for(int i=0;i!=tem.size();++i){
        for(int j = i+1;j<tem.size();++j){
            std::vector<long long> prox;
            prox.push_back(tem[i]*tem[j]);
            for(int k=0;k!=tem.size();++k){
                if(k==i||k==j)continue;
                prox.push_back(tem[k]);
            }
            std::sort(prox.begin(),prox.end());
            processa(prox);
        }
    }
}
void achar_divisores(long long x){
    for(int i=2;i!=1000000;++i){
        if(!(x%i)){
            while(!(x%i)){
                divisores.push_back(i);
                x/=i;
            }
        }
    }
    if(x>1)divisores.push_back(x);
}
int main()
{
    long long N;
    std::cin>>N;
    achar_divisores(N);
    processa(divisores);
    std::cout<<respostas.size()<<"\n";
    for(auto&x:respostas)std::cout<<x.first<<" ";
    std::cout<<"\n";
}

Compilation message

toy.cpp: In function 'void processa(std::vector<long long int>)':
toy.cpp:12:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(int i=0;i!=tem.size();++i){
      |                 ~^~~~~~~~~~~~
toy.cpp:13:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int j = i+1;j<tem.size();++j){
      |                         ~^~~~~~~~~~~
toy.cpp:16:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |             for(int k=0;k!=tem.size();++k){
      |                         ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 204 KB Output is correct
2 Correct 5 ms 204 KB Output is correct
3 Correct 5 ms 204 KB Output is correct
4 Correct 5 ms 284 KB Output is correct
5 Correct 5 ms 204 KB Output is correct
6 Correct 5 ms 204 KB Output is correct
7 Correct 5 ms 292 KB Output is correct
8 Correct 5 ms 288 KB Output is correct
9 Correct 5 ms 288 KB Output is correct
10 Correct 5 ms 284 KB Output is correct
11 Correct 5 ms 204 KB Output is correct
12 Correct 5 ms 204 KB Output is correct
13 Correct 5 ms 204 KB Output is correct
14 Correct 5 ms 204 KB Output is correct
15 Correct 5 ms 204 KB Output is correct
16 Correct 6 ms 204 KB Output is correct
17 Correct 5 ms 204 KB Output is correct
18 Correct 5 ms 204 KB Output is correct
19 Correct 5 ms 204 KB Output is correct
20 Correct 5 ms 332 KB Output is correct
21 Correct 6 ms 204 KB Output is correct
22 Correct 5 ms 204 KB Output is correct
23 Correct 5 ms 204 KB Output is correct
24 Correct 5 ms 204 KB Output is correct
25 Correct 5 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 204 KB Output is correct
2 Correct 5 ms 204 KB Output is correct
3 Correct 5 ms 204 KB Output is correct
4 Correct 5 ms 284 KB Output is correct
5 Correct 5 ms 204 KB Output is correct
6 Correct 5 ms 204 KB Output is correct
7 Correct 5 ms 292 KB Output is correct
8 Correct 5 ms 288 KB Output is correct
9 Correct 5 ms 288 KB Output is correct
10 Correct 5 ms 284 KB Output is correct
11 Correct 5 ms 204 KB Output is correct
12 Correct 5 ms 204 KB Output is correct
13 Correct 5 ms 204 KB Output is correct
14 Correct 5 ms 204 KB Output is correct
15 Correct 5 ms 204 KB Output is correct
16 Correct 6 ms 204 KB Output is correct
17 Correct 5 ms 204 KB Output is correct
18 Correct 5 ms 204 KB Output is correct
19 Correct 5 ms 204 KB Output is correct
20 Correct 5 ms 332 KB Output is correct
21 Correct 6 ms 204 KB Output is correct
22 Correct 5 ms 204 KB Output is correct
23 Correct 5 ms 204 KB Output is correct
24 Correct 5 ms 204 KB Output is correct
25 Correct 5 ms 204 KB Output is correct
26 Correct 524 ms 320 KB Output is correct
27 Correct 516 ms 332 KB Output is correct
28 Correct 23 ms 204 KB Output is correct
29 Correct 22 ms 308 KB Output is correct
30 Correct 6 ms 204 KB Output is correct
31 Execution timed out 5058 ms 464 KB Time limit exceeded
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 204 KB Output is correct
2 Correct 5 ms 204 KB Output is correct
3 Correct 5 ms 204 KB Output is correct
4 Correct 5 ms 284 KB Output is correct
5 Correct 5 ms 204 KB Output is correct
6 Correct 5 ms 204 KB Output is correct
7 Correct 5 ms 292 KB Output is correct
8 Correct 5 ms 288 KB Output is correct
9 Correct 5 ms 288 KB Output is correct
10 Correct 5 ms 284 KB Output is correct
11 Correct 5 ms 204 KB Output is correct
12 Correct 5 ms 204 KB Output is correct
13 Correct 5 ms 204 KB Output is correct
14 Correct 5 ms 204 KB Output is correct
15 Correct 5 ms 204 KB Output is correct
16 Correct 6 ms 204 KB Output is correct
17 Correct 5 ms 204 KB Output is correct
18 Correct 5 ms 204 KB Output is correct
19 Correct 5 ms 204 KB Output is correct
20 Correct 5 ms 332 KB Output is correct
21 Correct 6 ms 204 KB Output is correct
22 Correct 5 ms 204 KB Output is correct
23 Correct 5 ms 204 KB Output is correct
24 Correct 5 ms 204 KB Output is correct
25 Correct 5 ms 204 KB Output is correct
26 Correct 524 ms 320 KB Output is correct
27 Correct 516 ms 332 KB Output is correct
28 Correct 23 ms 204 KB Output is correct
29 Correct 22 ms 308 KB Output is correct
30 Correct 6 ms 204 KB Output is correct
31 Execution timed out 5058 ms 464 KB Time limit exceeded
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 204 KB Output is correct
2 Correct 5 ms 204 KB Output is correct
3 Correct 5 ms 204 KB Output is correct
4 Correct 5 ms 284 KB Output is correct
5 Correct 5 ms 204 KB Output is correct
6 Correct 5 ms 204 KB Output is correct
7 Correct 5 ms 292 KB Output is correct
8 Correct 5 ms 288 KB Output is correct
9 Correct 5 ms 288 KB Output is correct
10 Correct 5 ms 284 KB Output is correct
11 Correct 5 ms 204 KB Output is correct
12 Correct 5 ms 204 KB Output is correct
13 Correct 5 ms 204 KB Output is correct
14 Correct 5 ms 204 KB Output is correct
15 Correct 5 ms 204 KB Output is correct
16 Correct 6 ms 204 KB Output is correct
17 Correct 5 ms 204 KB Output is correct
18 Correct 5 ms 204 KB Output is correct
19 Correct 5 ms 204 KB Output is correct
20 Correct 5 ms 332 KB Output is correct
21 Correct 6 ms 204 KB Output is correct
22 Correct 5 ms 204 KB Output is correct
23 Correct 5 ms 204 KB Output is correct
24 Correct 5 ms 204 KB Output is correct
25 Correct 5 ms 204 KB Output is correct
26 Correct 524 ms 320 KB Output is correct
27 Correct 516 ms 332 KB Output is correct
28 Correct 23 ms 204 KB Output is correct
29 Correct 22 ms 308 KB Output is correct
30 Correct 6 ms 204 KB Output is correct
31 Execution timed out 5058 ms 464 KB Time limit exceeded
32 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 204 KB Output is correct
2 Correct 5 ms 204 KB Output is correct
3 Correct 5 ms 204 KB Output is correct
4 Correct 5 ms 284 KB Output is correct
5 Correct 5 ms 204 KB Output is correct
6 Correct 5 ms 204 KB Output is correct
7 Correct 5 ms 292 KB Output is correct
8 Correct 5 ms 288 KB Output is correct
9 Correct 5 ms 288 KB Output is correct
10 Correct 5 ms 284 KB Output is correct
11 Correct 5 ms 204 KB Output is correct
12 Correct 5 ms 204 KB Output is correct
13 Correct 5 ms 204 KB Output is correct
14 Correct 5 ms 204 KB Output is correct
15 Correct 5 ms 204 KB Output is correct
16 Correct 6 ms 204 KB Output is correct
17 Correct 5 ms 204 KB Output is correct
18 Correct 5 ms 204 KB Output is correct
19 Correct 5 ms 204 KB Output is correct
20 Correct 5 ms 332 KB Output is correct
21 Correct 6 ms 204 KB Output is correct
22 Correct 5 ms 204 KB Output is correct
23 Correct 5 ms 204 KB Output is correct
24 Correct 5 ms 204 KB Output is correct
25 Correct 5 ms 204 KB Output is correct
26 Correct 524 ms 320 KB Output is correct
27 Correct 516 ms 332 KB Output is correct
28 Correct 23 ms 204 KB Output is correct
29 Correct 22 ms 308 KB Output is correct
30 Correct 6 ms 204 KB Output is correct
31 Execution timed out 5058 ms 464 KB Time limit exceeded
32 Halted 0 ms 0 KB -