Submission #40070954
Source Code Expand
fun main() { val s = readLine()!! val map = mutableMapOf<String, Long>() val array = IntArray(10) map[array.join()] = 1 for(i in s.indices) { array[s[i] - '0']++ array[s[i] - '0'] %= 2 val key = array.join() map[key] = map.getOrDefault(key, 0) + 1 } var ans = 0L for((_, x) in map) { ans += (x * (x - 1)) / 2 } println(ans) } fun IntArray.join(): String { return this.joinToString("") }
Submission Info
Submission Time | |
---|---|
Task | D - Three Days Ago |
User | dhirabayashi |
Language | Kotlin (1.3.71) |
Score | 400 |
Code Size | 501 Byte |
Status | AC |
Exec Time | 503 ms |
Memory | 59508 KiB |
Compile Error
warning: ATTENTION! This build uses unsafe internal compiler arguments: -XXLanguage:+InlineClasses This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk!
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 110 ms | 38340 KiB |
sample_02.txt | AC | 99 ms | 38328 KiB |
sample_03.txt | AC | 98 ms | 38200 KiB |
test_01.txt | AC | 95 ms | 38312 KiB |
test_02.txt | AC | 99 ms | 38064 KiB |
test_03.txt | AC | 471 ms | 57920 KiB |
test_04.txt | AC | 483 ms | 58080 KiB |
test_05.txt | AC | 346 ms | 57192 KiB |
test_06.txt | AC | 395 ms | 57188 KiB |
test_07.txt | AC | 439 ms | 59360 KiB |
test_08.txt | AC | 366 ms | 57652 KiB |
test_09.txt | AC | 276 ms | 55752 KiB |
test_10.txt | AC | 331 ms | 56916 KiB |
test_11.txt | AC | 262 ms | 55852 KiB |
test_12.txt | AC | 428 ms | 59296 KiB |
test_13.txt | AC | 429 ms | 59508 KiB |
test_14.txt | AC | 300 ms | 56728 KiB |
test_15.txt | AC | 489 ms | 58132 KiB |
test_16.txt | AC | 503 ms | 58056 KiB |
test_17.txt | AC | 483 ms | 58076 KiB |
test_18.txt | AC | 503 ms | 58320 KiB |
test_19.txt | AC | 482 ms | 58080 KiB |
test_20.txt | AC | 485 ms | 58148 KiB |
test_21.txt | AC | 472 ms | 57980 KiB |
test_22.txt | AC | 469 ms | 57920 KiB |
test_23.txt | AC | 473 ms | 57788 KiB |
test_24.txt | AC | 478 ms | 57772 KiB |
test_25.txt | AC | 480 ms | 57932 KiB |
test_26.txt | AC | 474 ms | 58032 KiB |
test_27.txt | AC | 447 ms | 58100 KiB |
test_28.txt | AC | 310 ms | 56748 KiB |
test_29.txt | AC | 473 ms | 57960 KiB |
test_30.txt | AC | 481 ms | 58168 KiB |