#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){
if(l>60)return 0;
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));
REP(i,200)ans[i]=0;
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)!=ty)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 if(f1!=-1){
id+=1;
REP(j,3)ans[i+j]=bit(f1,2-j);
}
}
REP(i,n){
Set(i,ans[i]);
}
}
/*int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
int tp[15],as=15;
REP(i,as)tp[i]=i;
Anna(150,7,as,tp);
return 0;
}*/
#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
Bruno.cpp: In function 'll Bruno(int, int*)':
Bruno.cpp:28:5: warning: unused variable 'ti' [-Wunused-variable]
28 | ll ti=0,ans=0;
| ^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
50 ms |
3056 KB |
Output is partially correct - L* = 23 |
2 |
Partially correct |
50 ms |
3056 KB |
Output is partially correct - L* = 21 |
3 |
Partially correct |
48 ms |
3056 KB |
Output is partially correct - L* = 33 |
4 |
Partially correct |
49 ms |
3072 KB |
Output is partially correct - L* = 20 |
5 |
Partially correct |
52 ms |
3056 KB |
Output is partially correct - L* = 29 |
6 |
Partially correct |
49 ms |
3072 KB |
Output is partially correct - L* = 20 |
7 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 24 |
8 |
Partially correct |
48 ms |
3056 KB |
Output is partially correct - L* = 21 |
9 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 22 |
10 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 23 |
11 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 24 |
12 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 30 |
13 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 23 |
14 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 26 |
15 |
Partially correct |
52 ms |
3056 KB |
Output is partially correct - L* = 25 |
16 |
Partially correct |
49 ms |
3064 KB |
Output is partially correct - L* = 21 |
17 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 21 |
18 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 24 |
19 |
Partially correct |
49 ms |
3072 KB |
Output is partially correct - L* = 22 |
20 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 25 |
21 |
Partially correct |
49 ms |
3072 KB |
Output is partially correct - L* = 22 |
22 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 22 |
23 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 21 |
24 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 21 |
25 |
Partially correct |
51 ms |
3072 KB |
Output is partially correct - L* = 27 |
26 |
Partially correct |
48 ms |
3312 KB |
Output is partially correct - L* = 21 |
27 |
Partially correct |
50 ms |
3056 KB |
Output is partially correct - L* = 23 |
28 |
Partially correct |
50 ms |
2880 KB |
Output is partially correct - L* = 23 |
29 |
Partially correct |
49 ms |
3064 KB |
Output is partially correct - L* = 29 |
30 |
Partially correct |
51 ms |
2864 KB |
Output is partially correct - L* = 23 |
31 |
Partially correct |
51 ms |
3072 KB |
Output is partially correct - L* = 21 |
32 |
Partially correct |
49 ms |
3136 KB |
Output is partially correct - L* = 30 |
33 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 29 |
34 |
Partially correct |
50 ms |
3072 KB |
Output is partially correct - L* = 25 |
35 |
Partially correct |
50 ms |
3056 KB |
Output is partially correct - L* = 26 |
36 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 23 |
37 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 32 |
38 |
Partially correct |
48 ms |
3072 KB |
Output is partially correct - L* = 22 |
39 |
Partially correct |
49 ms |
3072 KB |
Output is partially correct - L* = 22 |
40 |
Partially correct |
49 ms |
3056 KB |
Output is partially correct - L* = 24 |