# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
310981 | Lawliet | Broken Device (JOI17_broken_device) | C++14 | 60 ms | 3328 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200;
int ord[MAXN];
bool blocked[MAXN];
void Anna(int N, long long X, int K, int P[])
{
srand( 43278432 );
iota( ord , ord + N , 0 );
random_shuffle( ord , ord + N );
memset( blocked , false , sizeof(blocked) );
for(int i = 0 ; i < K ; i++)
blocked[ P[i] ] = true;
for(int i = 0 ; i < N ; i += 2)
{
if( blocked[ ord[i] ] )
{
Set( ord[i] , 0 ); Set( ord[i + 1] , 0 );
continue;
}
if( X%2 == 1 && blocked[i + 1] )
{
Set( ord[i] , 0 ); Set( ord[i + 1] , 0 );
continue;
}
Set( ord[i] , 1 ); Set( ord[i + 1] , X%2 ); X /= 2;
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
const int MAXN = 200;
int orD[MAXN];
long long Bruno(int N, int A[])
{
srand( 43278432 );
iota( orD , orD + N , 0 );
random_shuffle( orD , orD + N );
lli ans = 0;
for(int i = N - 2 ; i >= 0 ; i -= 2)
if( A[ orD[i] ] == 1 ) ans *= 2, ans += A[ orD[i + 1] ];
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |