Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3,unroll-loops")
- #pragma GCC target("avx2,fma,mmx,bmi2")
- #include "bits/stdc++.h"
- using namespace std;
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- using namespace __gnu_pbds;
- template<class key, class cmp = std::less<key>>
- using oset = tree<key, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
- void __print(int x) {cerr << x;}
- void __print(long long x) {cerr << x;}
- void __print(unsigned x) {cerr << x;}
- void __print(unsigned long long x) {cerr << x;}
- void __print(double x) {cerr << x;}
- void __print(long double x) {cerr << x;}
- void __print(char x) {cerr << '\'' << x << '\'';}
- void __print(const char *x) {cerr << '\"' << x << '\"';}
- void __print(const string &x) {cerr << '\"' << x << '\"';}
- void __print(bool x) {cerr << (x ? "true" : "false");}
- template<typename T, typename V>
- void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
- template<typename T>
- void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
- void _print() {cerr << "]\n";}
- template <typename T, typename... V>
- void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
- #ifndef ONLINE_JUDGE
- #define bug(x...) cerr << "[" << #x << "] = ["; _print(x)
- #else
- #define bug(x...)
- #endif
- #define ll long long
- #define lld double
- #define all(x) x.begin(), x.end()
- #define iceil(n, x) (((n) + (x) - 1) / (x))
- #define gcd(a,b) __gcd(a,b)
- #define lcm(a,b) __detail::__lcm(a,b)
- #define goog(tno) cout << "Case #" << tno <<": "
- ll dx[]= {-1,-1,-1,0,0,1,1,1};
- ll dy[]= {-1,0,1,-1,1,-1,0,1};
- const ll INF=2e18;
- const ll mod=1000000007;
- const ll maxn=1e5+5;
- ll k;
- ll dp[65][10];
- bool vis[65][10];
- // 1->white
- // 2->yellow
- // 3->green
- // 4->blue
- // 5->red
- // 6->orange
- ll dfs(ll lvl,ll col){
- if(lvl==k) return 1;
- ll &ans=dp[lvl][col];
- if(vis[lvl][col]) return ans;
- vis[lvl][col]=1;
- ans=0;
- for(ll i=1;i<=6;i++){
- for(ll j=1;j<=6;j++){
- if(i==col||j==col) continue;
- if((i==2&&col==1)||(i==1&&col==2)||(j==1&&col==2)||(j==2&&col==1)) continue;
- if((i==3&&col==4)||(i==4&&col==3)||(j==3&&col==4)||(j==4&&col==3)) continue;
- if((i==5&&col==6)||(i==6&&col==5)||(j==5&&col==6)||(j==6&&col==5)) continue;
- ans=(ans+(dfs(lvl+1,i)*dfs(lvl+1,j))%mod)%mod;
- }
- }
- return ans;
- }
- void solve(){
- cin>>k;
- ll ans=0;
- for(ll i=1;i<=6;i++){
- ans=(ans+dfs(1,i))%mod;
- }
- cout<<ans<<'\n';
- }
- int main(){
- ios_base::sync_with_stdio(false), cin.tie(nullptr);
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- ll t=1;
- // cin>>t;
- while(t--) solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement