結果
| 問題 |
No.533 Mysterious Stairs
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-03-21 17:40:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| コンパイル時間 | 1,827 ms |
| コンパイル使用メモリ | 170,756 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-22 11:40:07 |
| 合計ジャッジ時間 | 2,639 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 16 |
ソースコード
#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;
temp[0][2]=1;
for(int i=0;i<N-1;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]-temp[j-1][3-j])%MOD;
}
}
cout<<temp[0][3]+temp[1][3]+temp[2][3]<<endl;
}
ytft