# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
207609 | autumn_eel | Broken Device (JOI17_broken_device) | C++14 | 54 ms | 3568 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>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
bool b[160],d[160];
void Anna(int N,ll X,int K,int P[]){
memset(b,0,sizeof(b));
memset(d,0,sizeof(d));
rep(i,K){
b[P[i]]=1;
}
for(int i=0;i<N;i+=2){
if(!b[i]&&!b[i+1]){
int e=X%3;
if(e==0)d[i]=0,d[i+1]=1;
if(e==1)d[i]=1,d[i+1]=0;
if(e==2)d[i]=1,d[i+1]=1;
X/=3;
}
}
rep(i,N)Set(i,d[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
ll Bruno(int N,int A[]){
ll ans=0;
for(int i=N-2;i>=0;i-=2){
if(A[i]||A[i+1]){
ans*=3;
ans+=A[i]*2+A[i+1]-1;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |