結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー 👑 tatt61880tatt61880
提出日時 2021-02-20 19:46:58
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 696 ms / 2,000 ms
コード長 1,008 bytes
コンパイル時間 2,250 ms
コンパイル使用メモリ 157,500 KB
実行使用メモリ 31,832 KB
最終ジャッジ日時 2023-10-14 17:17:39
合計ジャッジ時間 41,254 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 348 ms
17,860 KB
testcase_04 AC 347 ms
18,008 KB
testcase_05 AC 331 ms
17,608 KB
testcase_06 AC 332 ms
17,772 KB
testcase_07 AC 482 ms
23,812 KB
testcase_08 AC 482 ms
23,824 KB
testcase_09 AC 135 ms
8,936 KB
testcase_10 AC 133 ms
8,880 KB
testcase_11 AC 614 ms
28,660 KB
testcase_12 AC 608 ms
28,812 KB
testcase_13 AC 393 ms
20,120 KB
testcase_14 AC 392 ms
19,688 KB
testcase_15 AC 346 ms
17,248 KB
testcase_16 AC 351 ms
17,700 KB
testcase_17 AC 653 ms
29,764 KB
testcase_18 AC 656 ms
29,816 KB
testcase_19 AC 563 ms
26,296 KB
testcase_20 AC 562 ms
26,416 KB
testcase_21 AC 617 ms
28,128 KB
testcase_22 AC 609 ms
28,220 KB
testcase_23 AC 412 ms
21,028 KB
testcase_24 AC 414 ms
21,180 KB
testcase_25 AC 64 ms
6,388 KB
testcase_26 AC 64 ms
6,404 KB
testcase_27 AC 215 ms
12,420 KB
testcase_28 AC 215 ms
12,476 KB
testcase_29 AC 263 ms
14,576 KB
testcase_30 AC 261 ms
14,588 KB
testcase_31 AC 352 ms
18,064 KB
testcase_32 AC 353 ms
18,276 KB
testcase_33 AC 262 ms
14,144 KB
testcase_34 AC 261 ms
14,160 KB
testcase_35 AC 347 ms
17,540 KB
testcase_36 AC 344 ms
17,536 KB
testcase_37 AC 68 ms
6,344 KB
testcase_38 AC 69 ms
6,336 KB
testcase_39 AC 57 ms
5,956 KB
testcase_40 AC 57 ms
5,752 KB
testcase_41 AC 121 ms
8,616 KB
testcase_42 AC 121 ms
8,764 KB
testcase_43 AC 99 ms
7,712 KB
testcase_44 AC 639 ms
30,188 KB
testcase_45 AC 272 ms
14,808 KB
testcase_46 AC 93 ms
7,032 KB
testcase_47 AC 461 ms
22,176 KB
testcase_48 AC 429 ms
21,972 KB
testcase_49 AC 435 ms
22,028 KB
testcase_50 AC 338 ms
17,616 KB
testcase_51 AC 17 ms
4,508 KB
testcase_52 AC 575 ms
27,464 KB
testcase_53 AC 660 ms
31,500 KB
testcase_54 AC 684 ms
31,680 KB
testcase_55 AC 679 ms
31,464 KB
testcase_56 AC 683 ms
31,588 KB
testcase_57 AC 687 ms
31,688 KB
testcase_58 AC 683 ms
31,652 KB
testcase_59 AC 675 ms
31,496 KB
testcase_60 AC 667 ms
31,672 KB
testcase_61 AC 653 ms
31,504 KB
testcase_62 AC 677 ms
31,744 KB
testcase_63 AC 678 ms
31,696 KB
testcase_64 AC 688 ms
31,672 KB
testcase_65 AC 680 ms
31,500 KB
testcase_66 AC 673 ms
31,832 KB
testcase_67 AC 696 ms
31,632 KB
testcase_68 AC 676 ms
31,632 KB
testcase_69 AC 640 ms
31,556 KB
testcase_70 AC 646 ms
31,652 KB
testcase_71 AC 640 ms
31,520 KB
testcase_72 AC 686 ms
31,520 KB
testcase_73 AC 674 ms
31,736 KB
testcase_74 AC 673 ms
31,652 KB
testcase_75 AC 674 ms
31,668 KB
testcase_76 AC 671 ms
31,624 KB
testcase_77 AC 668 ms
31,688 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 x: [][]int :: #[n, 4]int
	for i(0, n - 1)
		do x[i][0] :: p[i]
		do x[i][1] :: e[i]
		do x[i][2] :: a[i]
		do x[i][3] :: h[i]
	end for
	
	var ans: int :: 0
	for i(0, n - 1)
		do x[i].sort()
		var d: int :: x[i].max() - x[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