結果

問題 No.434 占い
ユーザー tailstails
提出日時 2016-10-14 23:28:20
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 194 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-05-01 22:50:00
合計ジャッジ時間 4,936 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
18,048 KB
testcase_01 AC 54 ms
12,544 KB
testcase_02 AC 56 ms
12,800 KB
testcase_03 AC 66 ms
12,672 KB
testcase_04 AC 67 ms
12,672 KB
testcase_05 AC 67 ms
12,672 KB
testcase_06 AC 188 ms
12,672 KB
testcase_07 AC 180 ms
12,672 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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