結果
| 問題 |
No.432 占い(Easy)
|
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2016-10-28 19:09:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 1,418 ms |
| コンパイル使用メモリ | 167,444 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-24 05:16:16 |
| 合計ジャッジ時間 | 2,177 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int Q; string s;
int main() {
cin >> Q;
while(Q--) {
cin >> s;
while(s.size() > 1) {
string t;
for(int i = 1; i < s.size(); i++) t += a[(s[i] - 48) + (s[i - 1] - 48)] + 48;
s = t;
}
cout << s << endl;
}
}
square1001