Submission #1104485

#TimeUsernameProblemLanguageResultExecution timeMemory
1104485aaaaaarrozMachine (IOI24_machine)C++17
59 / 100
106 ms764 KiB
#include "machine.h" #include <bits/stdc++.h> using namespace std; vector<int>use_machine(vector<int> A); vector<int> find_permutation(int N) { map<int,int>pos; vector<int> A(N); for(int i=0;i<N-1;i++){ A[i]=i; pos[i]=i; } A[N-1]=2*N; pos[2*N]=N-1; vector<int>P(N); vector<int>B=use_machine(A); int x; for(x=0;x<=255;x++){ set<int>numeros; for(int numero:B){ numeros.insert(numero^x); } if(numeros.size()==N&&*numeros.begin()==0&&*numeros.rbegin()==2*(N)){ break; } } for(int i=0;i<N;i++){ P[i]=pos[B[i]^x]; } return P; }

Compilation message (stderr)

machine.cpp: In function 'std::vector<int> find_permutation(int)':
machine.cpp:22:24: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   22 |       if(numeros.size()==N&&*numeros.begin()==0&&*numeros.rbegin()==2*(N)){
      |          ~~~~~~~~~~~~~~^~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...