結果

問題 No.528 10^9と10^9+7と回文
ユーザー %20%20
提出日時 2017-06-10 00:04:26
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 288 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 5,412 KB
実行使用メモリ 24,012 KB
最終ジャッジ日時 2023-10-24 03:31:43
合計ジャッジ時間 3,411 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
24,012 KB
testcase_01 AC 9 ms
20,412 KB
testcase_02 AC 10 ms
5,628 KB
testcase_03 AC 10 ms
5,604 KB
testcase_04 AC 10 ms
5,604 KB
testcase_05 AC 10 ms
5,604 KB
testcase_06 AC 10 ms
5,604 KB
testcase_07 AC 10 ms
5,604 KB
testcase_08 AC 10 ms
5,604 KB
testcase_09 AC 9 ms
5,604 KB
testcase_10 TLE -
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 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$"='';
$b=($a=1e9)+7;
@N=<>=~/./g;
$K=@N;
$x=`dc -e'A $K 1-2/$a|A $K 2/$a|+2-p'`%$a;
$y=`dc -e'A $K 1-2/$b|A $K 2/$b|+2-p'`%$b;
$t+="@N[0..$K-1>>1,reverse 0..($K>>1)-1]"le"@N";
--$N[0];
$x+=`dc -e'@N[0..$K-1>>1] $t+$a%p'`;$x%=$a;
$y+=`dc -e'@N[0..$K-1>>1] $t+$b%p'`;$y%=$b;
print"$x\n$y"
0