Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
32344 | liuyile | 【S】T4 | C++ | 解答错误 | 0 | 316 MS | 1792 KB | 886 | 2024-09-08 15:51:45 |
#include <bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define i128 __int128_t const int lim=90; inline i128 trs(i128 S,int c){ i128 T=0; for(int i=0;i<c;i++) if((S>>i)&1) T|=((i128(1))<<(c-i)); T|=S>>c; T|=S<<c; return T&(((i128(1))<<lim+1)-1); } map<i128,int>id; int ct=0; inline void dfs(int dep,int rem,i128 S){ if(dep==10){ if(!id.count(S))id[S]=++ct; return ; } for(int i=0;i<=rem;i++) dfs(dep+1,rem-i,S),S=trs(S,dep); } signed main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); // freopen("true.in","r",stdin); // freopen("true.out","w",stdout); // int C=clock(); dfs(1,18,1); // cout<<(clock()-C)* 1000/CLOCKS_PER_SEC<<endl; cout<<ct<<endl; cout.flush(); fflush(stdout); return 0; }