# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
402744 |
2021-05-12T10:16:52 Z |
Antekb |
Parrots (IOI11_parrots) |
C++14 |
|
15 ms |
3772 KB |
#include "encoder.h"
#include "encoderlib.h"
#include<bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x);
vector<vector<int> > V2;
vector<int> akt2(4);
void gen2(int l, int i){
V2.pb(akt2);
if(l==0) return;
for(int j=i; j<4; j++){
akt2[j]++;
gen2(l-1, j);
akt2[j]--;
}
}
void encode(int N, int M[])
{
gen2(7, 0);
for(int i=0; i<N; i++){
for(int j=0; j<4; j++){
for(int k=0; k<V2[M[i]][j]; k++){
send(4*i+j);
}
}
}
}
#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x);
vector<vector<int> > V;
vector<int> akt(4);
void gen(int l, int i){
V.pb(akt);
if(l==0) return;
for(int j=i; j<4; j++){
akt[j]++;
gen(l-1, j);
akt[j]--;
}
}
void decode(int N, int L, int X[])
{
gen(7, 0);
//cout<<V.size();
sort(X, X+L);
int j=0;
for(int i=0; i<N; i++) {
vector<int> co(4);
while(j<L && X[j]<((i+1)*4)){
co[X[j++]-4*i]++;
}
for(int k=0; k<V.size(); k++){
if(co==V[k]){
output(k);
break;
}
}
}
}
Compilation message
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:28:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
28 | for(int k=0; k<V.size(); k++){
| ~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1128 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
3572 KB |
Output is correct |
2 |
Correct |
6 ms |
3576 KB |
Output is correct |
3 |
Correct |
7 ms |
3580 KB |
Output is correct |
4 |
Correct |
8 ms |
3580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
3576 KB |
Output is correct |
2 |
Correct |
6 ms |
3584 KB |
Output is correct |
3 |
Correct |
7 ms |
3576 KB |
Output is correct |
4 |
Correct |
7 ms |
3532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
3568 KB |
Output is correct |
2 |
Correct |
7 ms |
3576 KB |
Output is correct |
3 |
Correct |
9 ms |
3580 KB |
Output is correct |
4 |
Correct |
9 ms |
3592 KB |
Output is correct |
5 |
Correct |
10 ms |
3608 KB |
Output is correct |
6 |
Correct |
9 ms |
3604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
7 ms |
3588 KB |
Output is partially correct - P = 7.000000 |
2 |
Partially correct |
9 ms |
3680 KB |
Output is partially correct - P = 7.000000 |
3 |
Partially correct |
9 ms |
3600 KB |
Output is partially correct - P = 7.000000 |
4 |
Partially correct |
13 ms |
3732 KB |
Output is partially correct - P = 7.000000 |
5 |
Partially correct |
13 ms |
3748 KB |
Output is partially correct - P = 7.000000 |
6 |
Partially correct |
15 ms |
3772 KB |
Output is partially correct - P = 7.000000 |
7 |
Partially correct |
14 ms |
3764 KB |
Output is partially correct - P = 7.000000 |