# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959170 | Abito | Broken Device (JOI17_broken_device) | C++17 | 31 ms | 2868 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
bool vis[155];
int t1=2125252;
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=2125252;
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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |