結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-01-22 21:51:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 587 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 471 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 148,496 KB
最終ジャッジ日時 2024-12-27 23:51:07
合計ジャッジ時間 37,131 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 75
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k, m = map(int, input().split())
p = sorted(list(map(int, input().split())))
e = sorted(list(map(int, input().split())))
a = sorted(list(map(int, input().split())))
h = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
    l = [p[i], e[i], a[i], h[i]]
    ans += pow(max(l) - min(l), k, m)
    ans %= m
print(ans)
0