結果
問題 | No.1811 EQUIV Ten |
ユーザー | 蜜蜂 |
提出日時 | 2022-01-14 22:05:27 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 42 ms / 2,000 ms |
コード長 | 1,281 bytes |
コンパイル時間 | 3,465 ms |
コンパイル使用メモリ | 226,556 KB |
実行使用メモリ | 28,468 KB |
最終ジャッジ日時 | 2023-08-12 19:48:32 |
合計ジャッジ時間 | 5,305 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,376 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,380 KB |
testcase_09 | AC | 2 ms
4,380 KB |
testcase_10 | AC | 1 ms
4,380 KB |
testcase_11 | AC | 36 ms
24,172 KB |
testcase_12 | AC | 38 ms
25,940 KB |
testcase_13 | AC | 42 ms
27,788 KB |
testcase_14 | AC | 40 ms
28,420 KB |
testcase_15 | AC | 42 ms
28,468 KB |
testcase_16 | AC | 1 ms
4,376 KB |
testcase_17 | AC | 2 ms
4,380 KB |
testcase_18 | AC | 2 ms
4,384 KB |
testcase_19 | AC | 1 ms
4,380 KB |
testcase_20 | AC | 4 ms
4,468 KB |
testcase_21 | AC | 3 ms
4,384 KB |
testcase_22 | AC | 2 ms
4,380 KB |
testcase_23 | AC | 16 ms
11,864 KB |
testcase_24 | AC | 4 ms
5,168 KB |
testcase_25 | AC | 2 ms
4,380 KB |
testcase_26 | AC | 13 ms
10,256 KB |
testcase_27 | AC | 3 ms
4,376 KB |
testcase_28 | AC | 1 ms
4,384 KB |
testcase_29 | AC | 2 ms
4,376 KB |
testcase_30 | AC | 33 ms
23,584 KB |
testcase_31 | AC | 2 ms
4,380 KB |
testcase_32 | AC | 6 ms
5,324 KB |
testcase_33 | AC | 6 ms
5,616 KB |
testcase_34 | AC | 32 ms
22,480 KB |
testcase_35 | AC | 12 ms
10,260 KB |
ソースコード
//g++ 2.cpp -std=c++14 -O2 -I . #include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; using vvll = vector<vll>; using vld = vector<ld>; using vvld = vector<vld>; using vst = vector<string>; using vvst = vector<vst>; #define fi first #define se second #define pb push_back #define pq_big(T) priority_queue<T,vector<T>,less<T>> #define pq_small(T) priority_queue<T,vector<T>,greater<T>> #define all(a) a.begin(),a.end() #define rep(i,start,end) for(ll i=start;i<(ll)(end);i++) #define per(i,start,end) for(ll i=start;i>=(ll)(end);i--) #define uniq(a) sort(all(a));a.erase(unique(all(a)),a.end()) constexpr ll mod = 1e9+7; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; if(n<3){ cout<<0<<endl; return 0; } // n文字で1010を含む ll dp[n+1][16]={}; dp[0][0]=1; ll ans=0; rep(i,1,n+1){ rep(j,0,16){ rep(k,0,2){ int next=(2*j)%16+k; dp[i][next]+=dp[i-1][j]; dp[i][next]%=mod; } } ans+=dp[i][10]*pow_mod(2,n-i,mod); ans%=mod; dp[i][10]=0; //cout<<ans<<endl; } ans%=mod; cout<<ans<<endl; }