結果
問題 | No.314 ケンケンパ |
ユーザー |
|
提出日時 | 2023-03-23 01:43:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 89 ms / 1,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 4,419 ms |
コンパイル使用メモリ | 254,440 KB |
最終ジャッジ日時 | 2025-02-11 16:18:50 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h>using namespace std;#include <atcoder/all>using namespace atcoder;using ll = long long;#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)using mint = modint1000000007;using vm = vector<mint>;using vvm = vector<vm>;int main() {ll N;cin>>N;vvm DP(N+100,vm(4,0));DP[0][1]=1;rep(i,N)rep(j,4)rep(k,2){ll b=j*2+k;if(b==0||b%4==3)continue;DP[i+1][b%4]+=DP[i][j];}mint an=0;rep(i,4)an+=DP[N][i];cout<<an.val()<<endl;}