Submission #53589143
Source Code Expand
fun main() {
val n = readln().toInt()
val persons = List(n) {
val (s, c) = readln().split(" ")
s to c.toLong()
}
.sortedBy { it.first }
.mapIndexed { index, pair -> Person(pair.first, pair.second, index) }
val t = persons.map { it.c }.sum()
val ans = persons.filter { it.i.toLong() == t % n }.first().s
println(ans)
}
data class Person(
val s: String,
val c: Long,
val i: Int,
)
Submission Info
| Submission Time | |
|---|---|
| Task | B - AtCoder Janken 2 |
| User | dhirabayashi |
| Language | Kotlin (Kotlin/JVM 1.8.20) |
| Score | 200 |
| Code Size | 472 Byte |
| Status | AC |
| Exec Time | 79 ms |
| Memory | 43400 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 01_hand_00.txt, 01_hand_01.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 69 ms | 42792 KiB |
| 00_sample_01.txt | AC | 70 ms | 43112 KiB |
| 01_hand_00.txt | AC | 60 ms | 39808 KiB |
| 01_hand_01.txt | AC | 77 ms | 43028 KiB |
| 02_random_00.txt | AC | 73 ms | 42980 KiB |
| 02_random_01.txt | AC | 71 ms | 42812 KiB |
| 02_random_02.txt | AC | 75 ms | 43204 KiB |
| 02_random_03.txt | AC | 72 ms | 43064 KiB |
| 02_random_04.txt | AC | 75 ms | 43052 KiB |
| 02_random_05.txt | AC | 79 ms | 43240 KiB |
| 02_random_06.txt | AC | 77 ms | 43400 KiB |
| 02_random_07.txt | AC | 77 ms | 43012 KiB |
| 02_random_08.txt | AC | 79 ms | 43052 KiB |
| 02_random_09.txt | AC | 78 ms | 43056 KiB |