# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131589 | MohamedAhmed04 | Broken Device (JOI17_broken_device) | C++14 | 4 ms | 1012 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>
void Anna( int N, long long X, int K, int P[] )
{
int mark[N+1] ;
for(int i = 0 ; i <= N ; ++i)
mark[i] = 0 ;
for(int i = 0 ; i < K ; ++i)
mark[P[i]] = 1;
int finished = -1 ;
long long nxt = 0 ;
int cnt = 0 ;
for(int i = 0; i < N; i++ )
{
if(finished == i)
continue ;
if(mark[i+1] == 1|| mark[i] == 1)
Set(i , 0) ;
else if(nxt == 60)
Set(i , 0) ;
else
{
finished = i+1 ;
Set(i , 1) ;
int now = 0 ;
if((X & (1ll << nxt)))
Set(i+1 , 1) ;
else
Set(i+1 , 0) ;
nxt++ ;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std ;
long long Bruno( int N, int A[] )
{
long long ans = 0ll ;
long long nxt = 0 ;
int finished = -1 ;
for(int i = 0 ; i < N ; ++i)
{
if(finished == i)
continue ;
if(A[i] == 0)
continue ;
finished = i+1 ;
if(A[i+1] == 1)
ans += (1ll << nxt) ;
nxt++ ;
}
return ans ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |