結果

問題 No.432 占い(Easy)
ユーザー square1001square1001
提出日時 2016-10-28 19:07:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 1,319 ms
コンパイル使用メモリ 166,348 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-03 07:19:48
合計ジャッジ時間 2,097 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,820 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 3 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	}
}
0