結果

問題 No.432 占い(Easy)
ユーザー tailstails
提出日時 2016-10-14 22:43:28
言語 Perl
(5.38.2)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 943 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 11,456 KB
最終ジャッジ日時 2023-08-14 11:19:19
合計ジャッジ時間 4,421 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
11,456 KB
testcase_01 AC 34 ms
11,132 KB
testcase_02 AC 37 ms
11,108 KB
testcase_03 AC 43 ms
11,364 KB
testcase_04 AC 43 ms
11,212 KB
testcase_05 AC 42 ms
11,340 KB
testcase_06 AC 43 ms
11,168 KB
testcase_07 AC 43 ms
11,160 KB
testcase_08 AC 41 ms
11,188 KB
testcase_09 AC 128 ms
11,096 KB
testcase_10 AC 126 ms
11,396 KB
testcase_11 AC 131 ms
11,244 KB
testcase_12 AC 150 ms
11,292 KB
testcase_13 AC 153 ms
11,176 KB
testcase_14 AC 133 ms
11,104 KB
testcase_15 AC 44 ms
11,104 KB
testcase_16 AC 43 ms
11,384 KB
testcase_17 AC 140 ms
11,292 KB
testcase_18 AC 141 ms
11,188 KB
testcase_19 AC 136 ms
11,332 KB
testcase_20 AC 117 ms
11,168 KB
testcase_21 AC 122 ms
11,448 KB
testcase_22 AC 123 ms
11,120 KB
testcase_23 AC 125 ms
11,336 KB
testcase_24 AC 130 ms
11,244 KB
testcase_25 AC 128 ms
11,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use bigint;
$n=<>;
for(1..$n){
	$_=<>;
	chomp;
	$l=length;
	$s=0;
	$t=0;
	$i=1;
	$m=1;
	for(/./g){
		$t|=$_;
		$s=($s+$_*$m)%9;
		$m=$m*($l-$i)/$i;
		++$i;
	}
	$s=9 if $s==0&&$t;
	print$s,$/;
}
0