Submission #523588

#TimeUsernameProblemLanguageResultExecution timeMemory
523588DeepessonToys (CEOI18_toy)C++17
19 / 100
5058 ms464 KiB
#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 (stderr)

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 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...