# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
926933 | manizare | Bali Sculptures (APIO15_sculpture) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#define pb push_back
#define F first
#define S second
#define ld long double
#define all(a) a.begin(),a.end()
#define int long long
#define pii pair <int,int>
#define PII pair<pii , pii>
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= (b);i++)
#define per(i , a , b) for(int i=a;i >= (b);i--)
#define deb(x) cout <<#x << " : " << x << "\n" ;
using namespace std ;
const int maxn = 1e6 + 10 , c = 6 , maxp = 15e5 + 10 , inf= 1e18+10 ;
int ans[maxn] , dp[maxn] ,a3[100] , A[maxn] , B[maxn] , id[maxn] ;
bitset<258> mark[3000] ;
signed main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
a3[0] = 1;
rep(i , 1 , 30){
a3[i] = a3[i-1] * 3 ;
}
int n, Q; cin >> n >> Q ;
string s;
cin >> s;
rep(i , 1, (1<<n)-1){
int x= 1 ;
rep(j , 0 , n-1){
sm[i] = sm[i] + (i>>j&1)*a3[j] ;
}
}
rep(i , 0 , a3[c+1]-1){
rep(j , 0 , (1<<(c+1))-1){
mark[i][j] =1 ;
rep(k, 0 , c){
if((i/a3[k])%3!=0 && ((i/a3[k])%3)-1 != (j>>k&1)){
mark[i][j] = 0;
}
}
}
}
return 0;
}
/*
*/