Submission #63804853
Source Code Expand
Copy
fun main() {var S = StringBuilder(readln())var ans = 0for (i in 0 .. 202) {val Ssize = S.lengthif (i >= Ssize) breakif (i % 2 == 0 && S[i] != 'i') {S.insert(i, 'i')ans ++} else if (i % 2 == 1 && S[i] != 'o') {S.insert(i, 'o')ans ++}}if (S.last() == 'i') {ans++}
fun main() { var S = StringBuilder(readln()) var ans = 0 for (i in 0 .. 202) { val Ssize = S.length if (i >= Ssize) break if (i % 2 == 0 && S[i] != 'i') { S.insert(i, 'i') ans ++ } else if (i % 2 == 1 && S[i] != 'o') { S.insert(i, 'o') ans ++ } } if (S.last() == 'i') { ans++ } println(ans) }
Submission Info
Submission Time | |
---|---|
Task | B - Ticket Gate Log |
User | pent |
Language | Kotlin (Kotlin/JVM 1.8.20) |
Score | 250 |
Code Size | 442 Byte |
Status | AC |
Exec Time | 59 ms |
Memory | 39144 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 250 / 250 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 57 ms | 39004 KB |
00_sample_02.txt | AC | 55 ms | 39016 KB |
00_sample_03.txt | AC | 56 ms | 39084 KB |
01_random_01.txt | AC | 56 ms | 38944 KB |
01_random_02.txt | AC | 57 ms | 39100 KB |
01_random_03.txt | AC | 59 ms | 39072 KB |
01_random_04.txt | AC | 54 ms | 38992 KB |
01_random_05.txt | AC | 57 ms | 39012 KB |
01_random_06.txt | AC | 54 ms | 38880 KB |
01_random_07.txt | AC | 57 ms | 38940 KB |
01_random_08.txt | AC | 53 ms | 38908 KB |
01_random_09.txt | AC | 59 ms | 39044 KB |
01_random_10.txt | AC | 58 ms | 39144 KB |
02_handmade_01.txt | AC | 57 ms | 39084 KB |
02_handmade_02.txt | AC | 55 ms | 38980 KB |
02_handmade_03.txt | AC | 58 ms | 38948 KB |
02_handmade_04.txt | AC | 58 ms | 38968 KB |