結果
問題 |
No.432 占い(Easy)
|
ユーザー |
|
提出日時 | 2018-06-22 16:59:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 637 ms |
コンパイル使用メモリ | 74,384 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 18:00:25 |
合計ジャッジ時間 | 1,457 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int T; cin >> T; for(int i = 0; i < T; i++){ string S; cin >> S; vector<int> ans; for(int j = 0; j < S.size(); j++){ ans.push_back(S[j] - '0'); } for(int j = 0; j < S.size() - 1; j++){ vector<int> new_ans; for(int k = 0; k < ans.size() - 1; k++){ new_ans.push_back((ans[k] + ans[k + 1]) / 10 + (ans[k] + ans[k + 1]) % 10); } ans = new_ans; } cout << ans[0] << endl; } }