# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
530890 | qwerasdfzxcl | Broken Device (JOI17_broken_device) | C++14 | 41 ms | 2704 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static int a[] = {129,48,5,4,93,120,79,139,58,46,10,12,20,127,66,147,116,13,16,114,15,69,67,39,52,19,73,98,102,95,128,36,23,1,83,144,2,77,45,68,38,0,86,37,62,122,11,126,14,132,27,113,49,135,30,55,94,104,90,84,108,112,123,137,70,44,75,59,149,56,60,85,78,51,76,143,40,99,57,41,115,8,96,121,134,110,3,74,63,50,101,26,42,118,125,117,61,140,33,35,65,106,25,119,82,124,6,138,103,80,7,107,18,136,28,22,71,64,146,111,88,34,145,47,142,17,9,29,87,133,32,31,89,21,100,131,105,141,97,130,54,43,53,72,109,92,81,24,148,91};
void Anna( int N, long long X, int K, int P[] ){
bool chk[150] = {0};
for (int i=0;i<K;i++) chk[P[i]] = 1;
for (int i=0;i<150;i+=2){
if (chk[a[i]] || chk[a[i+1]]) {Set(a[i], 0); Set(a[i+1], 0);}
else {
if (X%3==0) {Set(a[i], 0); Set(a[i+1], 1);}
else if (X%3==1) {Set(a[i], 1); Set(a[i+1], 0);}
else {Set(a[i], 1); Set(a[i+1], 1);}
X /= 3;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static int a[] = {129,48,5,4,93,120,79,139,58,46,10,12,20,127,66,147,116,13,16,114,15,69,67,39,52,19,73,98,102,95,128,36,23,1,83,144,2,77,45,68,38,0,86,37,62,122,11,126,14,132,27,113,49,135,30,55,94,104,90,84,108,112,123,137,70,44,75,59,149,56,60,85,78,51,76,143,40,99,57,41,115,8,96,121,134,110,3,74,63,50,101,26,42,118,125,117,61,140,33,35,65,106,25,119,82,124,6,138,103,80,7,107,18,136,28,22,71,64,146,111,88,34,145,47,142,17,9,29,87,133,32,31,89,21,100,131,105,141,97,130,54,43,53,72,109,92,81,24,148,91};
long long Bruno( int N, int A[] ){
ll ans = 0;
for (int i=148;i>=0;i-=2){
if (!A[a[i]] && !A[a[i+1]]) continue;
ans *= 3;
if (A[a[i]]==0 && A[a[i+1]]==1) ans += 0;
else if (A[a[i]]==1 && A[a[i+1]]==0) ans += 1;
else ans += 2;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |