結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー McGregorshMcGregorsh
提出日時 2022-07-16 21:48:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 766 ms / 2,000 ms
コード長 1,721 bytes
コンパイル時間 903 ms
コンパイル使用メモリ 85,256 KB
実行使用メモリ 170,008 KB
最終ジャッジ日時 2023-09-11 07:47:04
合計ジャッジ時間 61,414 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 253 ms
92,204 KB
testcase_01 AC 256 ms
92,216 KB
testcase_02 AC 249 ms
92,372 KB
testcase_03 AC 591 ms
137,636 KB
testcase_04 AC 514 ms
137,700 KB
testcase_05 AC 493 ms
138,216 KB
testcase_06 AC 568 ms
138,196 KB
testcase_07 AC 584 ms
143,756 KB
testcase_08 AC 586 ms
143,728 KB
testcase_09 AC 361 ms
103,796 KB
testcase_10 AC 359 ms
103,744 KB
testcase_11 AC 678 ms
163,848 KB
testcase_12 AC 744 ms
164,288 KB
testcase_13 AC 516 ms
138,180 KB
testcase_14 AC 516 ms
138,096 KB
testcase_15 AC 506 ms
138,648 KB
testcase_16 AC 508 ms
138,636 KB
testcase_17 AC 691 ms
160,280 KB
testcase_18 AC 761 ms
160,388 KB
testcase_19 AC 636 ms
162,828 KB
testcase_20 AC 704 ms
163,012 KB
testcase_21 AC 734 ms
163,328 KB
testcase_22 AC 718 ms
163,324 KB
testcase_23 AC 565 ms
135,220 KB
testcase_24 AC 571 ms
135,296 KB
testcase_25 AC 313 ms
97,544 KB
testcase_26 AC 312 ms
97,372 KB
testcase_27 AC 402 ms
118,976 KB
testcase_28 AC 425 ms
118,712 KB
testcase_29 AC 439 ms
131,264 KB
testcase_30 AC 472 ms
131,048 KB
testcase_31 AC 563 ms
137,356 KB
testcase_32 AC 502 ms
137,500 KB
testcase_33 AC 501 ms
130,544 KB
testcase_34 AC 446 ms
130,552 KB
testcase_35 AC 559 ms
137,908 KB
testcase_36 AC 497 ms
137,980 KB
testcase_37 AC 354 ms
98,216 KB
testcase_38 AC 319 ms
98,448 KB
testcase_39 AC 315 ms
96,908 KB
testcase_40 AC 314 ms
96,804 KB
testcase_41 AC 408 ms
105,144 KB
testcase_42 AC 363 ms
104,808 KB
testcase_43 AC 375 ms
102,684 KB
testcase_44 AC 766 ms
153,196 KB
testcase_45 AC 520 ms
131,364 KB
testcase_46 AC 401 ms
100,908 KB
testcase_47 AC 618 ms
140,580 KB
testcase_48 AC 542 ms
136,668 KB
testcase_49 AC 592 ms
139,712 KB
testcase_50 AC 528 ms
138,160 KB
testcase_51 AC 284 ms
93,704 KB
testcase_52 AC 709 ms
170,008 KB
testcase_53 AC 690 ms
158,736 KB
testcase_54 AC 708 ms
157,916 KB
testcase_55 AC 712 ms
158,536 KB
testcase_56 AC 707 ms
157,724 KB
testcase_57 AC 698 ms
159,488 KB
testcase_58 AC 693 ms
158,076 KB
testcase_59 AC 697 ms
158,488 KB
testcase_60 AC 691 ms
158,976 KB
testcase_61 AC 677 ms
158,500 KB
testcase_62 AC 694 ms
159,136 KB
testcase_63 AC 693 ms
159,728 KB
testcase_64 AC 707 ms
158,276 KB
testcase_65 AC 700 ms
158,776 KB
testcase_66 AC 681 ms
159,340 KB
testcase_67 AC 689 ms
158,236 KB
testcase_68 AC 677 ms
157,740 KB
testcase_69 AC 668 ms
157,636 KB
testcase_70 AC 678 ms
158,344 KB
testcase_71 AC 664 ms
157,988 KB
testcase_72 AC 712 ms
158,544 KB
testcase_73 AC 694 ms
158,996 KB
testcase_74 AC 703 ms
157,736 KB
testcase_75 AC 694 ms
158,436 KB
testcase_76 AC 693 ms
159,540 KB
testcase_77 AC 685 ms
158,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re
from fractions import Fraction
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque, defaultdict
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement, permutations
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
def get_distance(x1, y1, x2, y2):
	  d = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
	  return d
def rotate(table):
   	  n_fild = []
   	  for x in zip(*table[::-1]):
   	  	  n_fild.append(x)
   	  return n_fild
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
MOD = 10 ** 9 + 7
MOD2 = 998244353


###関数コピーしたか?###
def main():
   
   n, k, m = i_map()
   p = i_list()
   e = i_list()
   a = i_list()
   h = i_list()
   p.sort()
   e.sort()
   a.sort()
   h.sort()
   
   ans = 0
   for i in range(n):
   	  max_num = max(p[i], e[i], a[i], h[i])
   	  min_num = min(p[i], e[i], a[i], h[i])
   	  score = max_num - min_num
   	  ans += pow(score, k, m)
   	  ans %= m
   print(ans)
   
   
   
if __name__ == '__main__':
    main()

0