#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
bool vis[155];
int t1=1294124;
void Anna( int n, long long X, int k, int p[] ){
memset(vis,0,sizeof(vis));
long long j=0;
t1++;
srand(t1);
int x=rand()%2;
//cout<<x<<endl;
for (int i=0;i<k;i++) vis[p[i]]=1;
if (x){
for (int i=0;i<n;i+=2){
if ((vis[i] && vis[i+1]) || j>=60LL){
Set(i,0);
Set(i+1,0);
continue;
}
if ((X&(1LL<<j)) && vis[i+1]){
Set(i,0);
Set(i+1,0);
continue;
}
if (X&(1LL<<j)){
Set(i,0);
Set(i+1,1);
j++;
continue;
}
if (!(X&(1LL<<j)) && vis[i]){
Set(i,0);
Set(i+1,0);
continue;
}
Set(i,1);
Set(i+1,0);
j++;
}return;}
for (int i=0;i<n;i+=2){
if ((vis[i] && vis[i+1]) || j>=60LL){
Set(i,0);
Set(i+1,0);
continue;
}
if ((X&(1LL<<j)) && vis[i]){
Set(i,0);
Set(i+1,0);
continue;
}
if (X&(1LL<<j)){
Set(i,1);
Set(i+1,0);
j++;
continue;
}
if (!(X&(1LL<<j)) && vis[i+1]){
Set(i,0);
Set(i+1,0);
continue;
}
Set(i,0);
Set(i+1,1);
j++;
}return;
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
int t2=1294124;
long long Bruno( int n, int a[] ){
//for (int i=0;i<n;i++) cout<<a[i]<<' ';cout<<endl;
t2++;
srand(t2);
int x=rand()%2;
//cout<<x<<endl;
long long X=0,j=0;
if (x){
for (int i=0;i<n;i+=2){
if (!a[i] && !a[i+1]) continue;
if (a[i+1]) X|=(1LL<<j);
j++;
}
return X;}
for (int i=0;i<n;i+=2){
if (!a[i] && !a[i+1]) continue;
if (a[i]) X|=(1LL<<j);
j++;
}return X;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
28 ms |
2396 KB |
Output is partially correct - L* = 17 |
2 |
Partially correct |
27 ms |
2392 KB |
Output is partially correct - L* = 16 |
3 |
Partially correct |
27 ms |
2400 KB |
Output is partially correct - L* = 19 |
4 |
Partially correct |
28 ms |
2396 KB |
Output is partially correct - L* = 17 |
5 |
Partially correct |
32 ms |
2396 KB |
Output is partially correct - L* = 17 |
6 |
Partially correct |
33 ms |
2376 KB |
Output is partially correct - L* = 20 |
7 |
Partially correct |
27 ms |
2524 KB |
Output is partially correct - L* = 18 |
8 |
Partially correct |
27 ms |
2400 KB |
Output is partially correct - L* = 18 |
9 |
Partially correct |
27 ms |
2400 KB |
Output is partially correct - L* = 18 |
10 |
Partially correct |
27 ms |
2408 KB |
Output is partially correct - L* = 16 |
11 |
Partially correct |
27 ms |
2392 KB |
Output is partially correct - L* = 17 |
12 |
Partially correct |
27 ms |
2392 KB |
Output is partially correct - L* = 22 |
13 |
Partially correct |
27 ms |
2304 KB |
Output is partially correct - L* = 18 |
14 |
Partially correct |
37 ms |
2304 KB |
Output is partially correct - L* = 18 |
15 |
Partially correct |
27 ms |
2488 KB |
Output is partially correct - L* = 16 |
16 |
Partially correct |
33 ms |
2396 KB |
Output is partially correct - L* = 17 |
17 |
Partially correct |
27 ms |
2404 KB |
Output is partially correct - L* = 22 |
18 |
Partially correct |
34 ms |
2460 KB |
Output is partially correct - L* = 16 |
19 |
Partially correct |
27 ms |
2460 KB |
Output is partially correct - L* = 18 |
20 |
Partially correct |
30 ms |
2396 KB |
Output is partially correct - L* = 15 |
21 |
Partially correct |
28 ms |
2368 KB |
Output is partially correct - L* = 15 |
22 |
Partially correct |
27 ms |
2392 KB |
Output is partially correct - L* = 17 |
23 |
Partially correct |
30 ms |
2392 KB |
Output is partially correct - L* = 15 |
24 |
Partially correct |
28 ms |
2732 KB |
Output is partially correct - L* = 17 |
25 |
Partially correct |
32 ms |
2508 KB |
Output is partially correct - L* = 21 |
26 |
Partially correct |
28 ms |
2304 KB |
Output is partially correct - L* = 16 |
27 |
Partially correct |
27 ms |
2472 KB |
Output is partially correct - L* = 15 |
28 |
Partially correct |
27 ms |
2396 KB |
Output is partially correct - L* = 16 |
29 |
Partially correct |
28 ms |
2480 KB |
Output is partially correct - L* = 16 |
30 |
Partially correct |
30 ms |
2312 KB |
Output is partially correct - L* = 21 |
31 |
Partially correct |
27 ms |
2484 KB |
Output is partially correct - L* = 15 |
32 |
Partially correct |
31 ms |
2508 KB |
Output is partially correct - L* = 18 |
33 |
Partially correct |
31 ms |
2460 KB |
Output is partially correct - L* = 17 |
34 |
Partially correct |
27 ms |
2392 KB |
Output is partially correct - L* = 19 |
35 |
Partially correct |
34 ms |
2480 KB |
Output is partially correct - L* = 16 |
36 |
Partially correct |
27 ms |
2400 KB |
Output is partially correct - L* = 15 |
37 |
Partially correct |
31 ms |
2396 KB |
Output is partially correct - L* = 16 |
38 |
Partially correct |
37 ms |
2520 KB |
Output is partially correct - L* = 18 |
39 |
Partially correct |
28 ms |
2512 KB |
Output is partially correct - L* = 17 |
40 |
Partially correct |
28 ms |
2576 KB |
Output is partially correct - L* = 17 |