結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー 👑 tatt61880tatt61880
提出日時 2021-02-20 19:49:12
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 665 ms / 2,000 ms
コード長 889 bytes
コンパイル時間 2,289 ms
コンパイル使用メモリ 152,976 KB
実行使用メモリ 9,836 KB
最終ジャッジ日時 2023-10-14 17:16:45
合計ジャッジ時間 39,688 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,368 KB
testcase_01 AC 2 ms
4,368 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 332 ms
6,500 KB
testcase_04 AC 332 ms
6,508 KB
testcase_05 AC 316 ms
6,460 KB
testcase_06 AC 314 ms
6,552 KB
testcase_07 AC 456 ms
7,864 KB
testcase_08 AC 456 ms
7,932 KB
testcase_09 AC 126 ms
4,756 KB
testcase_10 AC 127 ms
4,820 KB
testcase_11 AC 581 ms
9,128 KB
testcase_12 AC 578 ms
9,208 KB
testcase_13 AC 375 ms
7,136 KB
testcase_14 AC 373 ms
6,972 KB
testcase_15 AC 331 ms
6,616 KB
testcase_16 AC 330 ms
6,668 KB
testcase_17 AC 629 ms
9,524 KB
testcase_18 AC 622 ms
9,556 KB
testcase_19 AC 539 ms
8,620 KB
testcase_20 AC 537 ms
8,600 KB
testcase_21 AC 584 ms
8,868 KB
testcase_22 AC 582 ms
8,988 KB
testcase_23 AC 394 ms
7,400 KB
testcase_24 AC 394 ms
7,340 KB
testcase_25 AC 61 ms
4,372 KB
testcase_26 AC 60 ms
4,372 KB
testcase_27 AC 204 ms
5,596 KB
testcase_28 AC 204 ms
5,564 KB
testcase_29 AC 250 ms
6,072 KB
testcase_30 AC 250 ms
5,988 KB
testcase_31 AC 335 ms
6,808 KB
testcase_32 AC 333 ms
6,712 KB
testcase_33 AC 247 ms
5,812 KB
testcase_34 AC 247 ms
5,828 KB
testcase_35 AC 327 ms
6,580 KB
testcase_36 AC 327 ms
6,544 KB
testcase_37 AC 66 ms
4,368 KB
testcase_38 AC 66 ms
4,368 KB
testcase_39 AC 54 ms
4,376 KB
testcase_40 AC 54 ms
4,376 KB
testcase_41 AC 115 ms
4,644 KB
testcase_42 AC 114 ms
4,700 KB
testcase_43 AC 100 ms
4,396 KB
testcase_44 AC 606 ms
9,512 KB
testcase_45 AC 258 ms
5,924 KB
testcase_46 AC 88 ms
4,376 KB
testcase_47 AC 441 ms
7,632 KB
testcase_48 AC 407 ms
7,540 KB
testcase_49 AC 413 ms
7,676 KB
testcase_50 AC 320 ms
6,608 KB
testcase_51 AC 16 ms
4,368 KB
testcase_52 AC 546 ms
8,620 KB
testcase_53 AC 628 ms
9,808 KB
testcase_54 AC 654 ms
9,652 KB
testcase_55 AC 647 ms
9,784 KB
testcase_56 AC 647 ms
9,620 KB
testcase_57 AC 656 ms
9,656 KB
testcase_58 AC 652 ms
9,820 KB
testcase_59 AC 646 ms
9,716 KB
testcase_60 AC 635 ms
9,680 KB
testcase_61 AC 621 ms
9,776 KB
testcase_62 AC 644 ms
9,776 KB
testcase_63 AC 647 ms
9,676 KB
testcase_64 AC 652 ms
9,836 KB
testcase_65 AC 653 ms
9,768 KB
testcase_66 AC 636 ms
9,616 KB
testcase_67 AC 665 ms
9,620 KB
testcase_68 AC 649 ms
9,780 KB
testcase_69 AC 607 ms
9,680 KB
testcase_70 AC 616 ms
9,676 KB
testcase_71 AC 606 ms
9,820 KB
testcase_72 AC 655 ms
9,836 KB
testcase_73 AC 642 ms
9,772 KB
testcase_74 AC 638 ms
9,680 KB
testcase_75 AC 638 ms
9,808 KB
testcase_76 AC 636 ms
9,784 KB
testcase_77 AC 634 ms
9,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var k: int :: cui@inputInt()
	var m: int :: cui@inputInt()
	var p: []int :: #[n]int
	var e: []int :: #[n]int
	var a: []int :: #[n]int
	var h: []int :: #[n]int
	for i(0, n - 1)
		do p[i] :: cui@inputInt()
	end for
	for i(0, n - 1)
		do e[i] :: cui@inputInt()
	end for
	for i(0, n - 1)
		do a[i] :: cui@inputInt()
	end for
	for i(0, n - 1)
		do h[i] :: cui@inputInt()
	end for
	do p.sort()
	do e.sort()
	do a.sort()
	do h.sort()
	
	var ans: int :: 0
	for i(0, n - 1)
		var d: int :: [p[i], e[i], a[i], h[i]].max() - [p[i], e[i], a[i], h[i]].min()
		do ans :+ modPow(d, k, m)
	end for
	do ans :% m
	do cui@print("\{ans}\n")
	
	func modPow(a: int, b: int, mod: int): int
		if(b = 0)
			ret 1
		end if
		var res: int :: modPow(a, b / 2, mod)
		do res :: res * res % mod
		if(b % 2 = 1)
			do res :: res * a % mod
		end if
		ret res
	end func
end func
0