結果

問題 No.536 人工知能
ユーザー arbtarbt
提出日時 2017-09-17 12:13:20
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 347 ms / 1,000 ms
コード長 511 bytes
コンパイル時間 11,537 ms
コンパイル使用メモリ 436,144 KB
実行使用メモリ 55,340 KB
最終ジャッジ日時 2024-04-30 16:07:12
合計ジャッジ時間 16,317 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 337 ms
55,340 KB
testcase_01 AC 339 ms
55,224 KB
testcase_02 AC 337 ms
55,252 KB
testcase_03 AC 339 ms
55,168 KB
testcase_04 AC 339 ms
55,288 KB
testcase_05 AC 347 ms
55,288 KB
testcase_06 AC 338 ms
55,172 KB
testcase_07 AC 342 ms
55,132 KB
testcase_08 AC 338 ms
55,232 KB
testcase_09 AC 334 ms
55,240 KB
testcase_10 AC 341 ms
55,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:11:40: warning: 'toUpperCase(): String' is deprecated. Use uppercase() instead.
    if( len>=2 && S.substring(len - 2).toUpperCase()=="AI") {
                                       ^
Main.kt:19:11: warning: parameter 'argv' is never used
fun main( argv : Array<String> ) {
          ^

ソースコード

diff #

import java.util.Scanner

//
fun _Do() {

    val S = scan.next()// 1-
    
    val len = S.length
    
    if( len>=2 && S.substring(len - 2).toUpperCase()=="AI") {
        println(S.substring(0, len - 2) + "AI")
    }
    else
        println(S + "-AI")
}

var scan = Scanner(System.`in`)
fun main( argv : Array<String> ) {
    _Do()
}

fun strings(N:Int):Array<String> = Array(N,{scan.next()})
fun ints(N:Int):Array<Int> = Array(N,{scan.nextInt()})
fun longs(N:Int):Array<Long> = Array(N,{scan.nextLong()})
0