# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1077424 | LCJLY | Broken Device (JOI17_broken_device) | C++14 | 30 ms | 3180 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
void Anna(int n, long long val, int k, int p[]){
bool amos[155];
memset(amos,0,sizeof(amos));
for(int x=0;x<k;x++){
amos[p[x]]=true;
}
vector<int>v;
while(val>0){
v.push_back(val%3);
val/=3;
}
int ptr=0;
for(int x=0;x<n;x+=2){
if(amos[x]||amos[x+1]){
Set(x,0);
Set(x+1,0);
}
else if(ptr==(int)v.size()){
Set(x,0);
Set(x+1,0);
}
else{
if(v[ptr]==0){
Set(x,0);
Set(x+1,1);
}
else if(v[ptr]==1){
Set(x,1);
Set(x+1,0);
}
else{
Set(x,1);
Set(x+1,1);
}
ptr++;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
long long Bruno(int n, int a[]){
long long val=0;
long long take=1;
for(int x=0;x<n;x+=2){
if(a[x]==0&&a[x+1]==0) continue;
else{
int cur=0;
if(a[x]==1&&a[x+1]==0) cur=1;
if(a[x]==1&&a[x+1]==1) cur=2;
val=val+cur*take;
take*=3;
}
}
return val;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |