# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1215462 | jahongir | Broken Device (JOI17_broken_device) | C++20 | 19 ms | 1592 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void Anna( int N, long long X, int K, int P[] ){
int cnt = 0;
for(int i = 0, j = 0; i < N; i++){
while(P[j] < i && j < K) j++;
if((j < K && (P[j]==i || P[j]==i+1)) || i==N-1 || cnt == 60){
Set(i,0); continue;
}
Set(i,1);
if(X&(1ll<<cnt)) Set(i+1,1);
else Set(i+1,0);
cnt++, i++;
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long Bruno( int N, int A[] ){
int cnt = 0;
ll res = 0;
for(int i = 0; i < N; i++){
if(A[i]){
if(A[i+1]) res += (1ll<<cnt);
cnt++; i++;
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |