結果

問題 No.1092 modular arithmetic
ユーザー %20%20
提出日時 2020-06-24 10:02:24
言語 Ruby
(3.3.0)
結果
AC  
実行時間 819 ms / 2,000 ms
コード長 150 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 11,424 KB
実行使用メモリ 30,120 KB
最終ジャッジ日時 2023-09-16 20:57:52
合計ジャッジ時間 19,672 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,116 KB
testcase_01 AC 773 ms
28,916 KB
testcase_02 AC 72 ms
15,100 KB
testcase_03 AC 819 ms
29,980 KB
testcase_04 AC 622 ms
28,248 KB
testcase_05 AC 630 ms
27,980 KB
testcase_06 AC 477 ms
22,724 KB
testcase_07 AC 623 ms
28,164 KB
testcase_08 AC 678 ms
29,256 KB
testcase_09 AC 625 ms
27,380 KB
testcase_10 AC 506 ms
21,932 KB
testcase_11 AC 563 ms
21,808 KB
testcase_12 AC 464 ms
23,044 KB
testcase_13 AC 565 ms
25,784 KB
testcase_14 AC 646 ms
27,420 KB
testcase_15 AC 187 ms
17,600 KB
testcase_16 AC 510 ms
21,376 KB
testcase_17 AC 642 ms
27,572 KB
testcase_18 AC 738 ms
29,648 KB
testcase_19 AC 458 ms
22,972 KB
testcase_20 AC 756 ms
30,120 KB
testcase_21 AC 587 ms
27,084 KB
testcase_22 AC 757 ms
29,756 KB
testcase_23 AC 658 ms
21,696 KB
testcase_24 AC 249 ms
18,860 KB
testcase_25 AC 495 ms
22,916 KB
testcase_26 AC 640 ms
27,156 KB
testcase_27 AC 177 ms
16,616 KB
testcase_28 AC 496 ms
22,808 KB
testcase_29 AC 784 ms
29,464 KB
testcase_30 AC 505 ms
22,816 KB
testcase_31 AC 131 ms
16,440 KB
testcase_32 AC 449 ms
22,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Integer
alias_method:o,:*
def * a
self.o(a)%P
end
def / a
self*a.pow(P-2,P)
end
end
P=gets.to_i
p gets.split.inject{|a,b|eval"#{a}"+$<.getc+b}%P
0