#include <bits/stdc++.h>
using namespace std;
std::vector<int> get_attachment(std::vector<int> source) {
vector<int>ret;
for(auto k:source)
ret.push_back(k);
for(auto k:source)
ret.push_back(k);
return ret;
}
std::vector<int> retrieve(std::vector<int> data) {
int dif=-1;
vector<int>a,b,c,uc(2,0);
for(int i=0; i<int(data.size())/3; i++)
{
a.push_back(data[i]);
//cout << data[i];
}
//cout << endl;
for(int i=int(data.size())/3; i<int(data.size())-int(data.size())/3; i++)
{
b.push_back(data[i]);
if(b[int(b.size())-1]!=a[int(b.size())-1])
{
dif=int(b.size())-1;
}
//cout << data[i];
}
//cout << endl;
for(int i=int(data.size())-int(data.size())/3; i<int(data.size()); i++)
{
c.push_back(data[i]);
if(c[int(c.size())-1]!=a[int(c.size())-1])
{
dif=int(c.size())-1;
}
else if(c[int(c.size())-1]!=b[int(c.size())-1])
{
dif=int(c.size())-1;
}
//cout << data[i];
}
//cout << endl;
if(dif==-1)
return a;
//cout << dif;
uc[a[dif]]++;
uc[b[dif]]++;
uc[c[dif]]++;
if(uc[0]>uc[1])
a[dif]=0;
else
a[dif]=1;
//for(auto k:a)
//cout << k;
return a;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
10 ms |
1052 KB |
Partially correct |
2 |
Partially correct |
9 ms |
1056 KB |
Partially correct |
3 |
Partially correct |
10 ms |
1064 KB |
Partially correct |
4 |
Partially correct |
11 ms |
1224 KB |
Partially correct |
5 |
Partially correct |
10 ms |
1064 KB |
Partially correct |
6 |
Partially correct |
11 ms |
1056 KB |
Partially correct |
7 |
Partially correct |
10 ms |
1064 KB |
Partially correct |
8 |
Partially correct |
11 ms |
1056 KB |
Partially correct |
9 |
Partially correct |
13 ms |
1268 KB |
Partially correct |
10 |
Partially correct |
9 ms |
1060 KB |
Partially correct |
11 |
Partially correct |
9 ms |
1208 KB |
Partially correct |
12 |
Partially correct |
9 ms |
1056 KB |
Partially correct |
13 |
Partially correct |
12 ms |
1172 KB |
Partially correct |
14 |
Partially correct |
9 ms |
1048 KB |
Partially correct |
15 |
Partially correct |
12 ms |
1064 KB |
Partially correct |
16 |
Partially correct |
11 ms |
1056 KB |
Partially correct |
17 |
Partially correct |
11 ms |
1056 KB |
Partially correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
396 ms |
4940 KB |
Partially correct |
2 |
Partially correct |
406 ms |
4940 KB |
Partially correct |
3 |
Partially correct |
371 ms |
4944 KB |
Partially correct |
4 |
Partially correct |
415 ms |
4948 KB |
Partially correct |
5 |
Partially correct |
411 ms |
4940 KB |
Partially correct |
6 |
Partially correct |
396 ms |
4948 KB |
Partially correct |
7 |
Partially correct |
425 ms |
4952 KB |
Partially correct |
8 |
Partially correct |
373 ms |
4936 KB |
Partially correct |
9 |
Partially correct |
396 ms |
4856 KB |
Partially correct |
10 |
Partially correct |
397 ms |
4940 KB |
Partially correct |
11 |
Partially correct |
398 ms |
4952 KB |
Partially correct |
12 |
Partially correct |
376 ms |
4952 KB |
Partially correct |
13 |
Partially correct |
396 ms |
4948 KB |
Partially correct |
14 |
Partially correct |
360 ms |
4952 KB |
Partially correct |
15 |
Partially correct |
393 ms |
4936 KB |
Partially correct |
16 |
Partially correct |
375 ms |
4940 KB |
Partially correct |
17 |
Partially correct |
393 ms |
4936 KB |
Partially correct |
18 |
Partially correct |
394 ms |
4940 KB |
Partially correct |
19 |
Partially correct |
381 ms |
4944 KB |
Partially correct |