Submission #954873

#TimeUsernameProblemLanguageResultExecution timeMemory
954873MaaxleBroken Device (JOI17_broken_device)C++17
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> #include "Annalib.h" using namespace std; int vis[200], a[200], p=60, y; void Anna(int N, long long X, int k, int P[]){ for(int i=0; i<N; i++)vis[i]=0; for(int i=0; i<k; i++){ vis[P[i]]=-1; } for(int i=0; i<N-1; i++){ if(p<0)break; if(vis[i]!=0)continue; y=(X/(1ll>>p))%2; if(y==0){ a[i]=1; vis[i]=vis[i+1]=1; p--; } if(y==1 && vis[i+1]==0){ a[i]=vis[i]=a[i+1]=vis[i+1]=1; p--; } } for(int i=0; i<N; i++){ Set(i,a[i]); } return; }
#include <bits/stdc++.h> #include "Brunolib.h" using namespace std; long long res=0, p=60, vis[200]; long long Bruno(int N, int A[]){ for(int i=0; i<N; i++)vis[i]=0; for(int i=0; i<N-1; i++){ if(p<0)break; if(vis[i]==1 || A[i]==0)continue; res+=A[i+1]*(1ll>>p); p--; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...