# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
573544 | 2022-06-06T19:23:58 Z | Deepesson | Parrots (IOI11_parrots) | C++17 | 8 ms | 1356 KB |
/**Encoder**/ #include <bits/stdc++.h> //#include "encoder.h" //#include "encoderlib.h" void send(int a); std::string enviar; int qtdzeros,qtduns; void inserezero(void){ if(!qtdzeros)assert(0); --qtdzeros; enviar+="0"; } void insereum(void){ if(!qtduns)assert(0); --qtduns; enviar+="1"; } std::string plano; void codificar_e_enviar(){ //std::cout<<enviar<<" envia\n"; int cur=0; int count=0; for(auto&x:enviar){ if(x=='1'){ ++cur; }else {send(cur);++count;} } } void encode(int N, int M[]) { qtduns=256; qtdzeros=N*9; enviar=""; plano=""; int count = 0; for(int i=0;i!=N;++i){ for(int j=0;j!=8;++j){ bool valor = (bool)((M[i]^145)&(1<<j)); count+=valor; plano.push_back(valor+48); } } if(count>256){ insereum(); }else inserezero(); for(int i=0;i!=plano.size();++i){ bool valor = plano[i]-48; if(count>256){ valor=!valor; } if(valor)insereum();else inserezero(); } codificar_e_enviar(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 644 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 1032 KB | Output is correct |
2 | Correct | 2 ms | 1036 KB | Output is correct |
3 | Correct | 2 ms | 1036 KB | Output is correct |
4 | Correct | 3 ms | 1048 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 1036 KB | Output is correct |
2 | Correct | 3 ms | 1036 KB | Output is correct |
3 | Correct | 3 ms | 1036 KB | Output is correct |
4 | Correct | 3 ms | 1048 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1032 KB | Output is correct |
2 | Correct | 2 ms | 1004 KB | Output is correct |
3 | Correct | 3 ms | 1072 KB | Output is correct |
4 | Correct | 4 ms | 992 KB | Output is correct |
5 | Correct | 3 ms | 1036 KB | Output is correct |
6 | Correct | 4 ms | 1064 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 3 ms | 1048 KB | Output is partially correct - P = 5.125000 |
2 | Partially correct | 3 ms | 1064 KB | Output is partially correct - P = 5.031250 |
3 | Partially correct | 3 ms | 1004 KB | Output is partially correct - P = 5.030303 |
4 | Partially correct | 5 ms | 1284 KB | Output is partially correct - P = 5.020000 |
5 | Partially correct | 8 ms | 1356 KB | Output is partially correct - P = 5.016667 |
6 | Partially correct | 7 ms | 1348 KB | Output is partially correct - P = 5.015873 |
7 | Partially correct | 8 ms | 1324 KB | Output is partially correct - P = 5.015625 |