結果

問題 No.1335 1337
ユーザー CuriousFairy315CuriousFairy315
提出日時 2021-01-15 21:31:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 852 bytes
コンパイル時間 15,679 ms
コンパイル使用メモリ 418,772 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-08-17 16:10:13
合計ジャッジ時間 20,974 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 317 ms
53,932 KB
testcase_01 AC 312 ms
55,552 KB
testcase_02 AC 311 ms
53,808 KB
testcase_03 AC 318 ms
53,544 KB
testcase_04 AC 318 ms
55,912 KB
testcase_05 AC 314 ms
56,292 KB
testcase_06 AC 322 ms
55,556 KB
testcase_07 AC 313 ms
55,640 KB
testcase_08 AC 312 ms
55,788 KB
testcase_09 AC 317 ms
55,744 KB
testcase_10 AC 317 ms
54,056 KB
testcase_11 AC 331 ms
55,884 KB
testcase_12 AC 327 ms
54,328 KB
testcase_13 AC 321 ms
55,736 KB
testcase_14 AC 324 ms
56,312 KB
testcase_15 AC 321 ms
54,160 KB
testcase_16 AC 327 ms
54,100 KB
testcase_17 AC 323 ms
54,280 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:14:54: warning: 'toInt(): Int' is deprecated. Conversion of Char to Number is deprecated. Use Char.code property instead.
                if (Character.isDigit(c)) S[i] = A[c.toInt() - '0'.toInt()]
                                                     ^
Main.kt:14:68: warning: 'toInt(): Int' is deprecated. Conversion of Char to Number is deprecated. Use Char.code property instead.
                if (Character.isDigit(c)) S[i] = A[c.toInt() - '0'.toInt()]
                                                                   ^

ソースコード

diff #

package yukicoder

import java.util.*

class Main(private val args : Array<String>) : Runnable {
    override fun run() {
        solve(args)
    }
    private fun solve(@Suppress("UNUSED_PARAMETER") args: Array<String>) {
        Scanner(System.`in`).use { sc ->
            val A = sc.next().toCharArray()
            val S = sc.next().toCharArray()
            for ((i, c) in S.withIndex()) {
                if (Character.isDigit(c)) S[i] = A[c.toInt() - '0'.toInt()]
            }
            println(S)
        }
    }
}

/** 確保するメモリの大きさ(単位: MB)  */
private const val MEMORY: Long = 64

fun main(args: Array<String>) {
    Thread.setDefaultUncaughtExceptionHandler { _: Thread?, e: Throwable ->
        e.printStackTrace()
        System.exit(1)
    }
    Thread(null, Main(args = args), "", MEMORY * 1048576L).start()
}
0