Submission #916658

# Submission time Handle Problem Language Result Execution time Memory
916658 2024-01-26T08:49:44 Z Wansur Parrots (IOI11_parrots) C++14
17 / 100
14 ms 3224 KB
#include <bits/stdc++.h>
#define f first
#define s second
#define ent '\n';

using namespace std;
typedef long long ll;
const int mx=2e5+12;

void output(int b);
void send(int a);

int cnt[mx];
void encode(int n, int a[]){
	mt19937 rnd(1349);
	for(int i=0;i<n;i++){
		send(a[i]);
		for(int t=0;t<9;t++){
			int x=rnd()%256;
			send((a[i]^x));
		}
	}
}
#include <bits/stdc++.h>
#define f first
#define s second
#define ent '\n';

using namespace std;
typedef long long ll;
const int mx=2e5+12;

void output(int b);
void send(int a);

int cnt[mx];

void decode(int m, int n, int a[]){
	sort(a,a+n);
	for(int i=0;i<256;i++){
		cnt[i]=0;
	}
	for(int i=0;i<n;i++){
		cnt[a[i]]++;
	}
	mt19937 rnd(1349);
	for(int i=0;i<m;i++){
		vector<int> v;
		for(int t=0;t<9;t++){
			int x=rnd()%256;
			v.push_back(x);
		}
		for(int x=0;x<=256;x++){
			vector<int> t={x};
			int mn=--cnt[x];
			for(int y:v){
				mn=min(mn,--cnt[(x^y)]);
				t.push_back((x^y));
			}
			if(mn>=0){
				output(x);
				break;
			}
			for(int x:t){
				cnt[x]++;
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 2840 KB Output is correct
2 Incorrect 14 ms 2964 KB Error : Output length must be N
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 2852 KB Output is correct
2 Incorrect 10 ms 2860 KB Error : Output length must be N
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 2852 KB Output is correct
2 Incorrect 6 ms 2876 KB Error : Output length must be N
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2860 KB Error : Output length must be N
2 Incorrect 7 ms 2896 KB Error : Output length must be N
3 Incorrect 7 ms 2896 KB Error : Output length must be N
4 Incorrect 9 ms 3172 KB Error : Output length must be N
5 Incorrect 12 ms 2944 KB Error : Output length must be N
6 Incorrect 14 ms 3072 KB Error : Output length must be N
7 Incorrect 11 ms 3224 KB Error : Output length must be N