結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー 👑 箱
提出日時 2021-01-22 22:01:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 452 ms / 1,000 ms
コード長 879 bytes
コンパイル時間 15,334 ms
コンパイル使用メモリ 424,336 KB
実行使用メモリ 56,592 KB
最終ジャッジ日時 2023-08-27 19:08:19
合計ジャッジ時間 29,943 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 277 ms
52,816 KB
testcase_01 AC 273 ms
52,824 KB
testcase_02 AC 273 ms
52,876 KB
testcase_03 AC 274 ms
52,832 KB
testcase_04 AC 278 ms
52,820 KB
testcase_05 AC 275 ms
52,968 KB
testcase_06 AC 273 ms
53,004 KB
testcase_07 AC 275 ms
52,896 KB
testcase_08 AC 276 ms
52,912 KB
testcase_09 AC 278 ms
52,820 KB
testcase_10 AC 277 ms
52,944 KB
testcase_11 AC 279 ms
52,916 KB
testcase_12 AC 274 ms
53,348 KB
testcase_13 AC 422 ms
56,268 KB
testcase_14 AC 427 ms
56,220 KB
testcase_15 AC 331 ms
53,152 KB
testcase_16 AC 406 ms
56,412 KB
testcase_17 AC 444 ms
56,556 KB
testcase_18 AC 439 ms
56,356 KB
testcase_19 AC 452 ms
56,492 KB
testcase_20 AC 439 ms
56,384 KB
testcase_21 AC 424 ms
56,552 KB
testcase_22 AC 419 ms
56,432 KB
testcase_23 AC 427 ms
56,592 KB
testcase_24 AC 425 ms
56,368 KB
testcase_25 AC 450 ms
56,376 KB
testcase_26 AC 447 ms
56,336 KB
testcase_27 AC 428 ms
56,336 KB
testcase_28 AC 425 ms
56,432 KB
testcase_29 AC 445 ms
56,312 KB
testcase_30 AC 447 ms
56,544 KB
testcase_31 AC 441 ms
56,308 KB
testcase_32 AC 445 ms
56,324 KB
testcase_33 AC 423 ms
56,388 KB
testcase_34 AC 414 ms
56,240 KB
testcase_35 AC 279 ms
52,816 KB
testcase_36 AC 275 ms
52,996 KB
testcase_37 AC 279 ms
52,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val s = nextLine()
    val map = mutableMapOf<Char, Int>()
    for (c in s) {
        map[c] = (map[c] ?: 0) + 1
    }
    for (c in map.keys) {
        if (map[c]!! == 1) {
            print(s.indices.first { s[it] == c } + 1)
            print(" ")
            print(c)
            println()
        }
    }
}

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
0