Submission #1104485

# Submission time Handle Problem Language Result Execution time Memory
1104485 2024-10-23T23:25:52 Z aaaaaarroz Machine (IOI24_machine) C++17
59 / 100
106 ms 764 KB
#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

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 time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 48 ms 444 KB Output is correct
3 Correct 25 ms 464 KB Output is correct
4 Correct 44 ms 336 KB Output is correct
5 Correct 56 ms 336 KB Output is correct
6 Correct 89 ms 336 KB Output is correct
7 Correct 102 ms 584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 44 ms 460 KB Output is correct
3 Correct 26 ms 336 KB Output is correct
4 Correct 61 ms 508 KB Output is correct
5 Correct 58 ms 448 KB Output is correct
6 Correct 95 ms 336 KB Output is correct
7 Correct 106 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 34 ms 460 KB Output is correct
3 Correct 30 ms 452 KB Output is correct
4 Correct 45 ms 336 KB Output is correct
5 Correct 61 ms 592 KB Output is correct
6 Correct 91 ms 336 KB Output is correct
7 Correct 101 ms 448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 700 KB Output is correct
2 Correct 32 ms 336 KB Output is correct
3 Correct 33 ms 764 KB Output is correct
4 Correct 50 ms 508 KB Output is correct
5 Correct 59 ms 336 KB Output is correct
6 Correct 99 ms 440 KB Output is correct
7 Correct 96 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid element in query vector
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid element in query vector
2 Halted 0 ms 0 KB -