結果
| 問題 |
No.1595 The Final Digit
|
| コンテスト | |
| ユーザー |
Bas_shii
|
| 提出日時 | 2021-07-09 22:23:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 320 bytes |
| コンパイル時間 | 594 ms |
| コンパイル使用メモリ | 68,736 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-01 16:59:06 |
| 合計ジャッジ時間 | 2,495 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 10 RE * 7 |
ソースコード
#include<iostream>
#include<vector>
using namespace std;
int main(){
long p,q,r,k;cin >> p >> q >> r >> k;
vector<int> calc(k);
calc[0]=p%10;
calc[1]=q%10;
calc[2]=r%10;
for(int i=3;i<k;i++){
calc[i]=(calc[i-1]+calc[i-2]+calc[i-3])%10;
}
cout << calc[k-1] << endl;
return 0;
}
Bas_shii