結果

問題 No.816 Beautiful tuples
ユーザー maimai
提出日時 2019-04-25 23:32:49
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 325 ms / 1,500 ms
コード長 331 bytes
コンパイル時間 12,531 ms
コンパイル使用メモリ 413,696 KB
実行使用メモリ 54,008 KB
最終ジャッジ日時 2023-08-13 01:51:02
合計ジャッジ時間 18,311 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 314 ms
53,648 KB
testcase_01 AC 313 ms
53,776 KB
testcase_02 AC 319 ms
53,580 KB
testcase_03 AC 319 ms
53,728 KB
testcase_04 AC 314 ms
53,684 KB
testcase_05 AC 315 ms
53,572 KB
testcase_06 AC 315 ms
53,784 KB
testcase_07 AC 317 ms
53,584 KB
testcase_08 AC 325 ms
53,748 KB
testcase_09 AC 316 ms
53,768 KB
testcase_10 AC 311 ms
54,008 KB
testcase_11 AC 312 ms
53,952 KB
testcase_12 AC 314 ms
53,856 KB
testcase_13 AC 316 ms
54,008 KB
testcase_14 AC 318 ms
53,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner

val sc = Scanner(System.`in`)

fun main(){
    var a = sc.nextInt()
    var b = sc.nextInt()
    
    if (a > b)
        a = b.also{ b = a }
    
    if (a*2 == b)
        println(a*3)
    else if (a*3 == b)
        println(a*2)
    else if (a*3 == b*2)
        println(a/2)
    else
        println(-1)
}
0