結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー U SU S
提出日時 2021-01-22 22:01:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 582 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 549 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 148,356 KB
最終ジャッジ日時 2023-08-27 19:10:21
合計ジャッジ時間 38,334 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
73,420 KB
testcase_01 AC 116 ms
73,072 KB
testcase_02 AC 116 ms
73,256 KB
testcase_03 AC 368 ms
117,296 KB
testcase_04 AC 356 ms
117,212 KB
testcase_05 AC 343 ms
116,868 KB
testcase_06 AC 342 ms
117,264 KB
testcase_07 AC 439 ms
134,812 KB
testcase_08 AC 441 ms
134,980 KB
testcase_09 AC 211 ms
90,140 KB
testcase_10 AC 213 ms
90,336 KB
testcase_11 AC 525 ms
139,436 KB
testcase_12 AC 527 ms
139,576 KB
testcase_13 AC 382 ms
121,752 KB
testcase_14 AC 383 ms
121,928 KB
testcase_15 AC 356 ms
118,424 KB
testcase_16 AC 355 ms
118,276 KB
testcase_17 AC 561 ms
143,052 KB
testcase_18 AC 566 ms
142,884 KB
testcase_19 AC 505 ms
148,116 KB
testcase_20 AC 509 ms
147,916 KB
testcase_21 AC 536 ms
142,484 KB
testcase_22 AC 534 ms
142,812 KB
testcase_23 AC 390 ms
121,812 KB
testcase_24 AC 397 ms
121,728 KB
testcase_25 AC 167 ms
81,868 KB
testcase_26 AC 164 ms
81,560 KB
testcase_27 AC 269 ms
105,676 KB
testcase_28 AC 267 ms
105,488 KB
testcase_29 AC 303 ms
117,412 KB
testcase_30 AC 300 ms
117,136 KB
testcase_31 AC 360 ms
119,272 KB
testcase_32 AC 358 ms
119,300 KB
testcase_33 AC 299 ms
116,344 KB
testcase_34 AC 303 ms
116,600 KB
testcase_35 AC 350 ms
116,472 KB
testcase_36 AC 350 ms
116,276 KB
testcase_37 AC 169 ms
83,104 KB
testcase_38 AC 172 ms
83,232 KB
testcase_39 AC 160 ms
81,204 KB
testcase_40 AC 162 ms
81,108 KB
testcase_41 AC 202 ms
89,900 KB
testcase_42 AC 203 ms
89,752 KB
testcase_43 AC 188 ms
87,088 KB
testcase_44 AC 549 ms
141,308 KB
testcase_45 AC 313 ms
116,756 KB
testcase_46 AC 187 ms
86,408 KB
testcase_47 AC 438 ms
122,928 KB
testcase_48 AC 400 ms
119,788 KB
testcase_49 AC 409 ms
123,232 KB
testcase_50 AC 353 ms
117,036 KB
testcase_51 AC 136 ms
78,968 KB
testcase_52 AC 507 ms
148,356 KB
testcase_53 AC 552 ms
142,296 KB
testcase_54 AC 574 ms
141,416 KB
testcase_55 AC 571 ms
141,848 KB
testcase_56 AC 570 ms
141,476 KB
testcase_57 AC 577 ms
142,060 KB
testcase_58 AC 569 ms
141,692 KB
testcase_59 AC 566 ms
142,292 KB
testcase_60 AC 560 ms
142,008 KB
testcase_61 AC 544 ms
141,952 KB
testcase_62 AC 566 ms
142,516 KB
testcase_63 AC 571 ms
142,016 KB
testcase_64 AC 572 ms
141,672 KB
testcase_65 AC 566 ms
141,640 KB
testcase_66 AC 557 ms
142,140 KB
testcase_67 AC 582 ms
141,832 KB
testcase_68 AC 565 ms
141,668 KB
testcase_69 AC 531 ms
141,552 KB
testcase_70 AC 539 ms
142,016 KB
testcase_71 AC 537 ms
142,108 KB
testcase_72 AC 576 ms
141,996 KB
testcase_73 AC 570 ms
141,628 KB
testcase_74 AC 572 ms
141,668 KB
testcase_75 AC 573 ms
142,204 KB
testcase_76 AC 564 ms
142,452 KB
testcase_77 AC 565 ms
141,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys
# input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
import math
import bisect
from copy import deepcopy as dc
from itertools import accumulate
from collections import Counter, defaultdict, deque
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1

n,k,m = mp()
p = []
for i in range(4):
    a = lmp()
    a.sort()
    p.append(a)
ans = 0
for i in range(n):
    q = []
    for j in range(4):
        q.append(p[j][i])
    d = max(q)-min(q)
    ans += pow(d,k,m)
print(ans%m)


    


0