結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー simansiman
提出日時 2021-12-18 04:27:46
言語 Ruby
(3.3.0)
結果
AC  
実行時間 705 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 825 ms
コンパイル使用メモリ 11,148 KB
実行使用メモリ 55,760 KB
最終ジャッジ日時 2023-10-13 08:35:43
合計ジャッジ時間 48,432 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
15,060 KB
testcase_01 AC 69 ms
15,212 KB
testcase_02 AC 71 ms
15,204 KB
testcase_03 AC 362 ms
37,944 KB
testcase_04 AC 369 ms
37,960 KB
testcase_05 AC 353 ms
37,972 KB
testcase_06 AC 362 ms
38,076 KB
testcase_07 AC 514 ms
50,132 KB
testcase_08 AC 488 ms
50,140 KB
testcase_09 AC 175 ms
23,004 KB
testcase_10 AC 177 ms
23,024 KB
testcase_11 AC 595 ms
53,972 KB
testcase_12 AC 611 ms
54,112 KB
testcase_13 AC 396 ms
39,424 KB
testcase_14 AC 392 ms
39,200 KB
testcase_15 AC 353 ms
37,952 KB
testcase_16 AC 359 ms
37,780 KB
testcase_17 AC 628 ms
54,916 KB
testcase_18 AC 624 ms
54,848 KB
testcase_19 AC 547 ms
52,016 KB
testcase_20 AC 556 ms
52,248 KB
testcase_21 AC 596 ms
53,512 KB
testcase_22 AC 594 ms
53,648 KB
testcase_23 AC 416 ms
39,968 KB
testcase_24 AC 419 ms
39,896 KB
testcase_25 AC 117 ms
18,296 KB
testcase_26 AC 121 ms
18,268 KB
testcase_27 AC 241 ms
28,516 KB
testcase_28 AC 242 ms
28,472 KB
testcase_29 AC 286 ms
26,960 KB
testcase_30 AC 280 ms
27,072 KB
testcase_31 AC 366 ms
38,284 KB
testcase_32 AC 370 ms
38,256 KB
testcase_33 AC 297 ms
27,024 KB
testcase_34 AC 290 ms
26,972 KB
testcase_35 AC 369 ms
38,100 KB
testcase_36 AC 358 ms
38,148 KB
testcase_37 AC 124 ms
18,684 KB
testcase_38 AC 127 ms
18,644 KB
testcase_39 AC 118 ms
18,584 KB
testcase_40 AC 117 ms
18,452 KB
testcase_41 AC 169 ms
22,668 KB
testcase_42 AC 174 ms
22,812 KB
testcase_43 AC 149 ms
21,920 KB
testcase_44 AC 621 ms
54,768 KB
testcase_45 AC 299 ms
26,884 KB
testcase_46 AC 148 ms
21,908 KB
testcase_47 AC 437 ms
40,356 KB
testcase_48 AC 436 ms
40,516 KB
testcase_49 AC 430 ms
40,732 KB
testcase_50 AC 363 ms
37,652 KB
testcase_51 AC 84 ms
15,868 KB
testcase_52 AC 592 ms
52,936 KB
testcase_53 AC 643 ms
55,712 KB
testcase_54 AC 648 ms
55,700 KB
testcase_55 AC 663 ms
55,592 KB
testcase_56 AC 676 ms
55,644 KB
testcase_57 AC 659 ms
55,544 KB
testcase_58 AC 653 ms
55,704 KB
testcase_59 AC 653 ms
55,620 KB
testcase_60 AC 649 ms
55,484 KB
testcase_61 AC 648 ms
55,744 KB
testcase_62 AC 656 ms
55,584 KB
testcase_63 AC 673 ms
55,692 KB
testcase_64 AC 671 ms
55,740 KB
testcase_65 AC 658 ms
55,544 KB
testcase_66 AC 675 ms
55,540 KB
testcase_67 AC 705 ms
55,760 KB
testcase_68 AC 657 ms
55,548 KB
testcase_69 AC 639 ms
55,552 KB
testcase_70 AC 656 ms
55,584 KB
testcase_71 AC 636 ms
55,616 KB
testcase_72 AC 666 ms
55,680 KB
testcase_73 AC 574 ms
55,644 KB
testcase_74 AC 566 ms
55,700 KB
testcase_75 AC 538 ms
55,576 KB
testcase_76 AC 554 ms
55,480 KB
testcase_77 AC 552 ms
55,648 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, K, M = gets.split.map(&:to_i)
P = gets.split.map(&:to_i).sort
E = gets.split.map(&:to_i).sort
A = gets.split.map(&:to_i).sort
H = gets.split.map(&:to_i).sort

ans = 0

N.times do |i|
  min, max = [P[i], E[i], A[i], H[i]].minmax
  ans += (max - min).pow(K, M)
  ans %= M
end

puts ans
0