結果

問題 No.894 二種類のバス
ユーザー firiexpfiriexp
提出日時 2019-09-27 21:35:18
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 307 ms / 1,000 ms
コード長 602 bytes
コンパイル時間 13,281 ms
コンパイル使用メモリ 437,052 KB
実行使用メモリ 54,460 KB
最終ジャッジ日時 2023-10-25 01:59:59
合計ジャッジ時間 20,691 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 305 ms
54,448 KB
testcase_01 AC 302 ms
54,444 KB
testcase_02 AC 306 ms
54,452 KB
testcase_03 AC 307 ms
54,460 KB
testcase_04 AC 302 ms
54,444 KB
testcase_05 AC 302 ms
54,440 KB
testcase_06 AC 303 ms
54,452 KB
testcase_07 AC 307 ms
54,448 KB
testcase_08 AC 307 ms
54,452 KB
testcase_09 AC 306 ms
54,440 KB
testcase_10 AC 303 ms
54,444 KB
testcase_11 AC 300 ms
54,432 KB
testcase_12 AC 300 ms
54,436 KB
testcase_13 AC 302 ms
54,436 KB
testcase_14 AC 301 ms
54,436 KB
testcase_15 AC 304 ms
54,432 KB
testcase_16 AC 304 ms
54,444 KB
testcase_17 AC 304 ms
54,432 KB
testcase_18 AC 304 ms
54,440 KB
testcase_19 AC 301 ms
54,444 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:15:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import java.io.PrintWriter
import java.math.BigInteger

val cout = PrintWriter(System.out)

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readLong() = readLn().toInt()
fun readDouble() = readLn().toDouble()
fun readStrings() = readLn().split(" ")
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }
fun readDoubles() = readStrings().map { it.toDouble() }

fun main(args: Array<String>) {
    var (t, a, b) = readStrings().map { it.toBigInteger() }
    t -= BigInteger.ONE
    println(t/a + t/b - t/(a*b/a.gcd(b))+ BigInteger.ONE)
}

0