結果
問題 | No.1359 [Zelkova 3rd Tune] 四人セゾン |
ユーザー | 箱星 |
提出日時 | 2021-01-22 23:50:25 |
言語 | Kotlin (1.9.23) |
結果 |
AC
|
実行時間 | 1,399 ms / 2,000 ms |
コード長 | 1,267 bytes |
コンパイル時間 | 13,759 ms |
コンパイル使用メモリ | 436,404 KB |
実行使用メモリ | 104,264 KB |
最終ジャッジ日時 | 2024-06-09 04:23:52 |
合計ジャッジ時間 | 93,399 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 268 ms
53,476 KB |
testcase_01 | AC | 279 ms
53,272 KB |
testcase_02 | AC | 275 ms
53,648 KB |
testcase_03 | AC | 956 ms
92,680 KB |
testcase_04 | AC | 1,018 ms
92,420 KB |
testcase_05 | AC | 1,056 ms
88,804 KB |
testcase_06 | AC | 959 ms
88,996 KB |
testcase_07 | AC | 1,060 ms
96,016 KB |
testcase_08 | AC | 1,214 ms
95,852 KB |
testcase_09 | AC | 611 ms
78,964 KB |
testcase_10 | AC | 673 ms
81,220 KB |
testcase_11 | AC | 1,151 ms
97,064 KB |
testcase_12 | AC | 1,133 ms
97,164 KB |
testcase_13 | AC | 1,030 ms
99,480 KB |
testcase_14 | AC | 1,018 ms
95,936 KB |
testcase_15 | AC | 973 ms
88,832 KB |
testcase_16 | AC | 958 ms
95,144 KB |
testcase_17 | AC | 1,093 ms
100,704 KB |
testcase_18 | AC | 1,219 ms
100,568 KB |
testcase_19 | AC | 1,121 ms
96,660 KB |
testcase_20 | AC | 1,121 ms
95,524 KB |
testcase_21 | AC | 1,294 ms
97,064 KB |
testcase_22 | AC | 1,177 ms
98,676 KB |
testcase_23 | AC | 1,095 ms
94,636 KB |
testcase_24 | AC | 984 ms
94,824 KB |
testcase_25 | AC | 536 ms
68,016 KB |
testcase_26 | AC | 519 ms
67,860 KB |
testcase_27 | AC | 792 ms
93,204 KB |
testcase_28 | AC | 770 ms
88,472 KB |
testcase_29 | AC | 853 ms
94,744 KB |
testcase_30 | AC | 807 ms
92,808 KB |
testcase_31 | AC | 899 ms
92,708 KB |
testcase_32 | AC | 930 ms
88,860 KB |
testcase_33 | AC | 836 ms
88,404 KB |
testcase_34 | AC | 750 ms
92,720 KB |
testcase_35 | AC | 911 ms
89,084 KB |
testcase_36 | AC | 857 ms
92,940 KB |
testcase_37 | AC | 545 ms
67,852 KB |
testcase_38 | AC | 537 ms
68,652 KB |
testcase_39 | AC | 523 ms
65,020 KB |
testcase_40 | AC | 519 ms
65,524 KB |
testcase_41 | AC | 651 ms
78,356 KB |
testcase_42 | AC | 592 ms
77,804 KB |
testcase_43 | AC | 580 ms
74,392 KB |
testcase_44 | AC | 1,167 ms
101,100 KB |
testcase_45 | AC | 889 ms
88,620 KB |
testcase_46 | AC | 584 ms
73,180 KB |
testcase_47 | AC | 1,069 ms
95,480 KB |
testcase_48 | AC | 996 ms
95,156 KB |
testcase_49 | AC | 962 ms
95,312 KB |
testcase_50 | AC | 913 ms
88,860 KB |
testcase_51 | AC | 426 ms
58,404 KB |
testcase_52 | AC | 1,099 ms
98,432 KB |
testcase_53 | AC | 1,399 ms
102,568 KB |
testcase_54 | AC | 1,258 ms
103,520 KB |
testcase_55 | AC | 1,181 ms
104,264 KB |
testcase_56 | AC | 1,128 ms
103,456 KB |
testcase_57 | AC | 1,210 ms
103,448 KB |
testcase_58 | AC | 1,067 ms
103,408 KB |
testcase_59 | AC | 1,227 ms
103,220 KB |
testcase_60 | AC | 1,139 ms
103,576 KB |
testcase_61 | AC | 1,198 ms
103,728 KB |
testcase_62 | AC | 1,127 ms
102,452 KB |
testcase_63 | AC | 1,225 ms
103,468 KB |
testcase_64 | AC | 1,132 ms
103,304 KB |
testcase_65 | AC | 1,143 ms
103,384 KB |
testcase_66 | AC | 1,109 ms
103,492 KB |
testcase_67 | AC | 1,091 ms
103,576 KB |
testcase_68 | AC | 1,221 ms
103,400 KB |
testcase_69 | AC | 1,183 ms
103,424 KB |
testcase_70 | AC | 1,112 ms
102,568 KB |
testcase_71 | AC | 1,270 ms
103,800 KB |
testcase_72 | AC | 1,170 ms
103,564 KB |
testcase_73 | AC | 1,206 ms
103,408 KB |
testcase_74 | AC | 1,240 ms
103,624 KB |
testcase_75 | AC | 1,343 ms
103,444 KB |
testcase_76 | AC | 1,169 ms
103,320 KB |
testcase_77 | AC | 1,151 ms
103,496 KB |
コンパイルメッセージ
Main.kt:28:26: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Long val d = arr.max()!! - arr.min()!! ^ Main.kt:28:40: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Long val d = arr.max()!! - arr.min()!! ^
ソースコード
import java.io.PrintWriter import java.util.* import kotlin.math.* fun modpow(a: Long, e: Long, m: Long): Long { if (e == 0L) return 1 % m if (e == 1L) return a % m val b = modpow(a, e / 2, m) if (e % 2 == 0L) return b * b % m else return (b * b % m) * a % m } fun PrintWriter.solve() { val n = nextInt() val k = nextLong() val m = nextLong() val p = LongArray(n) { nextLong() } val e = LongArray(n) { nextLong() } val a = LongArray(n) { nextLong() } val h = LongArray(n) { nextLong() } p.sort() e.sort() a.sort() h.sort() var ans = 0L for (i in 0 until n) { val arr = arrayOf(p[i], e[i], a[i], h[i]) val d = arr.max()!! - arr.min()!! ans += modpow(d, k, m) ans %= m } println(ans) } fun main() { val writer = PrintWriter(System.out, false) writer.solve() writer.flush() } // region Scanner private var st = StringTokenizer("") private val br = System.`in`.bufferedReader() fun next(): String { while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) return st.nextToken() } fun nextInt() = next().toInt() fun nextLong() = next().toLong() fun nextLine() = br.readLine()!! fun nextDouble() = next().toDouble() // endregion