結果

問題 No.528 10^9と10^9+7と回文
ユーザー tailstails
提出日時 2017-06-10 00:33:49
言語 Perl
(5.38.2)
結果
AC  
実行時間 182 ms / 1,000 ms
コード長 181 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 4,700 KB
最終ジャッジ日時 2023-10-01 00:56:26
合計ジャッジ時間 3,356 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,600 KB
testcase_01 AC 3 ms
4,444 KB
testcase_02 AC 3 ms
4,472 KB
testcase_03 AC 3 ms
4,576 KB
testcase_04 AC 3 ms
4,576 KB
testcase_05 AC 3 ms
4,476 KB
testcase_06 AC 3 ms
4,600 KB
testcase_07 AC 3 ms
4,536 KB
testcase_08 AC 3 ms
4,492 KB
testcase_09 AC 2 ms
4,584 KB
testcase_10 AC 182 ms
4,700 KB
testcase_11 AC 178 ms
4,676 KB
testcase_12 AC 178 ms
4,572 KB
testcase_13 AC 178 ms
4,576 KB
testcase_14 AC 107 ms
4,648 KB
testcase_15 AC 95 ms
4,628 KB
testcase_16 AC 87 ms
4,648 KB
testcase_17 AC 73 ms
4,644 KB
testcase_18 AC 170 ms
4,604 KB
testcase_19 AC 50 ms
4,472 KB
testcase_20 AC 124 ms
4,624 KB
testcase_21 AC 72 ms
4,644 KB
testcase_22 AC 2 ms
4,600 KB
testcase_23 AC 3 ms
4,604 KB
testcase_24 AC 5 ms
4,572 KB
testcase_25 AC 20 ms
4,608 KB
testcase_26 AC 178 ms
4,692 KB
testcase_27 AC 177 ms
4,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Possible precedence problem on bitwise | operator at Main.pl line 5.
Main.pl syntax OK

ソースコード

diff #

$_=<>;$l=y///c;
for$m(1e9,1e9+7){
	$f=$r=0;
	for$i(0..$l/2-1){
		$r=($r.0+n($i)+($i>0|$l&1)*9)%$m;
		$f=n($i)<=>n($l-$i-2)||$f;
	}
	print+($r-($f>0))%$m,$/;
}
sub n{substr$_,"@_",1}
0