Submission #916640

# Submission time Handle Problem Language Result Execution time Memory
916640 2024-01-26T08:20:19 Z Wansur Parrots (IOI11_parrots) C++14
17 / 100
2 ms 3104 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];
int a[mx];


void encode(int n, int daun[]){
	srand(6932);
	for(int i=0;i<n;i++){
		a[i]=daun[i];
		int x=rand()%256;
		a[i]^=x;
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<=i;j++){
			send(a[i]);
		}
	}
}
#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];
int a[mx];

void decode(int m, int n, int a[]){
	srand(6932);
	for(int i=0;i<256;i++){
		cnt[i]=0;
	}
	for(int i=0;i<n;i++){
		cnt[a[i]]++;
	}
	for(int i=0;i<m;i++){
		pair<int,int> mn={1e9,0};
		for(int x=0;x<256;x++){
			if(cnt[x]>0)mn=min(mn,{cnt[x],x});
		}
		int x=(rand()%256);
		output((x^mn.s));
		cnt[mn.s]-=i+1;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2848 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 3104 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2848 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2864 KB Error : Output is wrong
2 Incorrect 1 ms 2840 KB Error : Encoded message too long
3 Incorrect 1 ms 2840 KB Error : Encoded message too long
4 Incorrect 1 ms 2844 KB Error : Encoded message too long
5 Incorrect 1 ms 2844 KB Error : Encoded message too long
6 Incorrect 1 ms 2844 KB Error : Encoded message too long
7 Incorrect 1 ms 2840 KB Error : Encoded message too long