# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
578501 | alireza_kaviani | Broken Device (JOI17_broken_device) | C++17 | 42 ms | 2684 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;
typedef long long ll;
const ll LOG = 60;
const ll MAXN = 150;
static int mark[MAXN];
void Anna(int N, ll x, int K, int P[]){
for(int i = 0 ; i < K ; i++){
mark[P[i]] = 1;
}
for(int i = 0 ; i < N ; i += 2){
if(mark[i] || mark[i + 1]){
Set(i , 0);
Set(i + 1 , 0);
continue;
}
if(x % 3 == 0){
Set(i , 1);
Set(i + 1 , 0);
}
if(x % 3 == 1){
Set(i , 0);
Set(i + 1 , 1);
}
if(x % 3 == 2){
Set(i , 1);
Set(i + 1 , 1);
}
x /= 3;
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll LOG = 60;
const ll MAXN = 150;
long long Bruno(int N, int A[]){
ll ans = 0 , val = 1;
for(int i = 0 ; i < N ; i += 2){
if(A[i] == 0 && A[i + 1] == 0){
continue;
}
ans += (A[i] + A[i + 1] * 2 - 1) * val;
val *= 3;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |