結果
問題 |
No.533 Mysterious Stairs
|
ユーザー |
![]() |
提出日時 | 2021-03-21 17:37:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 522 bytes |
コンパイル時間 | 1,612 ms |
コンパイル使用メモリ | 170,544 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 11:36:53 |
合計ジャッジ時間 | 2,800 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<vector<long long>> temp(3,vector<long long>(4,0)); long long MOD=pow(10,9)+7; temp[0][3]=1; for(int i=0;i<N;i++){ for(int j=0;j<3;j++){ for(int k=0;k<3;k++){ temp[k][j]=temp[k][j+1]; } } for(int j=1;j<=3;j++){ temp[j-1][3]=(temp[0][3-j]+temp[1][3-j]+temp[2][3-j])%MOD; } } cout<<temp[0][3]+temp[1][3]+temp[2][3]<<endl; }