# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
916733 |
2024-01-26T12:13:10 Z |
Wansur |
Parrots (IOI11_parrots) |
C++14 |
|
12 ms |
15460 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);
vector<int> g[mx];
int cnt[mx];
int p[mx];
void encode(int n, int a[]){
int last=0;
vector<int> x,y;
for(int i=0;i<n;i++){
for(int j=0;j<8;j+=2){
if((a[i]&(1<<j))){
x.push_back(last);
}
else y.push_back(last);
if((a[i]&(1<<(j+1)))){
x.push_back(last);
x.push_back(last);
}
else{
y.push_back(last);
y.push_back(last);
}
last++;
}
}
y.push_back(0);
y.push_back(0);
y.push_back(0);
y.push_back(0);
if(x.size()>y.size()){
x.swap(y);
}
for(int d:x){
send(d);
}
}
#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);
vector<int> g[mx];
int cnt[mx];
int p[mx];
void decode(int m, int n, int a[]){
sort(a,a+n);
for(int i=0;i<256;i++){
cnt[i]=0;
g[i].clear();
}
for(int i=0;i<n;i++){
cnt[a[i]]++;
}
bool ok=0;
if(cnt[0]>=4){
ok=1;
cnt[0]-=4;
}
for(int i=0;i<256;i++){
if(ok)cnt[i]=3-cnt[i];
}
int last=0;
for(int i=0;i<m;i++){
int x=0;
for(int j=0;j<8;j+=2){
while(cnt[last]--){
x+=(1<<j);
}
last++;
}
output(x);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
15120 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
15140 KB |
Output is correct |
2 |
Correct |
5 ms |
15300 KB |
Output is correct |
3 |
Correct |
6 ms |
15148 KB |
Output is correct |
4 |
Correct |
5 ms |
15136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
15128 KB |
Output is correct |
2 |
Correct |
5 ms |
15360 KB |
Output is correct |
3 |
Correct |
6 ms |
15360 KB |
Output is correct |
4 |
Correct |
5 ms |
15148 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
15140 KB |
Output is correct |
2 |
Correct |
5 ms |
15116 KB |
Output is correct |
3 |
Correct |
5 ms |
15156 KB |
Output is correct |
4 |
Correct |
6 ms |
15156 KB |
Output is correct |
5 |
Correct |
7 ms |
15160 KB |
Output is correct |
6 |
Correct |
8 ms |
15160 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
5 ms |
15148 KB |
Output is partially correct - P = 6.125000 |
2 |
Partially correct |
7 ms |
15156 KB |
Output is partially correct - P = 6.062500 |
3 |
Partially correct |
6 ms |
15160 KB |
Output is partially correct - P = 6.060606 |
4 |
Partially correct |
10 ms |
15440 KB |
Output is partially correct - P = 6.020000 |
5 |
Partially correct |
9 ms |
15452 KB |
Output is partially correct - P = 6.033333 |
6 |
Partially correct |
12 ms |
15456 KB |
Output is partially correct - P = 6.031746 |
7 |
Partially correct |
8 ms |
15460 KB |
Output is partially correct - P = 6.031250 |