結果

問題 No.434 占い
ユーザー LogicR_pimanLogicR_piman
提出日時 2016-10-20 23:18:06
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 414 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 52,240 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-14 17:45:23
合計ジャッジ時間 3,461 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 39 ms
4,376 KB
testcase_09 AC 6 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 AC 13 ms
4,380 KB
testcase_13 AC 39 ms
4,376 KB
testcase_14 AC 5 ms
4,376 KB
testcase_15 RE -
testcase_16 AC 375 ms
4,376 KB
testcase_17 AC 40 ms
4,376 KB
testcase_18 AC 9 ms
4,380 KB
testcase_19 AC 16 ms
4,380 KB
testcase_20 AC 120 ms
4,376 KB
testcase_21 RE -
testcase_22 AC 371 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 367 ms
4,380 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 19 ms
4,376 KB
testcase_28 AC 16 ms
4,376 KB
testcase_29 AC 20 ms
4,376 KB
testcase_30 AC 93 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>

using namespace std;

int main() {
	int i, j, n, l, a[10000];
	string s;

	cin >> n;

	for (j = 0; j < n; j++) {
		cin >> s;

		l = s.length();

		for (i = 0; i < l; i++) {
			a[i] = (s[i]) - 48;
		}

		while (l != 1) {
			for (i = 0; i < l - 1; i++) {
				a[i] += a[i + 1];
				if (a[i] > 9) {
					a[i] -= 9;
				}
			}
			l -= 1;
		}
		cout << a[0] << endl;
	}

	return 0;
}
0