Submission #313107

#TimeUsernameProblemLanguageResultExecution timeMemory
313107YJUBroken Device (JOI17_broken_device)C++14
0 / 100
68 ms3368 KiB
#include<bits/stdc++.h> #include"Annalib.h" #pragma GCC optimize("unroll-loops,no-stack-protector") using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> pll; const ll MOD=1e9+7; const ll MOD2=998244353; const ll N=4e5+5; const ll K=350; const ld pi=3.14159265359; const ll INF=(1LL<<40); #define SQ(i) ((i)*(i)) #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define pb push_back #define mp make_pair #define X first #define Y second #define setp setprecision #define lwb lower_bound #define SZ(_a) (ll)_a.size() bool bit(ll k,ll l){ return (k>>l)&1; } void Anna(int n,ll x,int k,int *p){ bool vis[200];REP(i,200)vis[i]=1;REP(i,k)vis[p[i]]=0; vector<ll> s[8]={{},{1},{0},{0,0},{1},{0,1},{1,0},{1,1}}; bool ans[200];memset(ans,0,sizeof(ans)); ll id=0; for(int i=0;i<n;i+=3){ vector<ll> tmp; tmp.pb(bit(x,id));tmp.pb(bit(x,id+1)); if(vis[i]+vis[i+1]+vis[i+2]<=1){continue;} ll f1=-1,f2=-1,mask=(vis[i]*4+vis[i+1]*2+vis[i+2]); for(int ty=1;ty<8;ty++){ if((mask&ty)!=mask)continue; if(SZ(s[ty])==1){ if(s[ty][0]==tmp[0])f1=ty; }else{ if(s[ty]==tmp)f2=ty; } } if(f2!=-1){ id+=2; REP(j,3)ans[i+j]=bit(f2,2-j); }else{ id+=1; REP(j,3)ans[i+j]=bit(f1,2-j); } } REP(i,n)Set(i,ans[i]); }
#include<bits/stdc++.h> #include"Brunolib.h" #pragma GCC optimize("unroll-loops,no-stack-protector") using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> pll; const ll MOD=1e9+7; const ll MOD2=998244353; const ll N=4e5+5; const ll K=350; const ld pi=3.14159265359; const ll INF=(1LL<<40); #define SQ(i) ((i)*(i)) #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define pb push_back #define mp make_pair #define X first #define Y second #define setp setprecision #define lwb lower_bound #define SZ(_a) (ll)_a.size() ll Bruno(int n,int *A){ ll ti=0,ans=0; vector<ll> s[8]={{},{1},{0},{0,0},{1},{0,1},{1,0},{1,1}}; vector<ll> tans; for(int i=0;i<n;i+=3){ ll mask=A[i]*4+A[i+1]*2+A[i+2]; for(auto j:s[mask])tans.pb(j); } REP(i,SZ(tans))if(tans[i])ans+=(1LL<<i); return ans; return ans; }

Compilation message (stderr)

Bruno.cpp: In function 'll Bruno(int, int*)':
Bruno.cpp:28:5: warning: unused variable 'ti' [-Wunused-variable]
   28 |  ll ti=0,ans=0;
      |     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...