結果

問題 No.894 二種類のバス
ユーザー firiexpfiriexp
提出日時 2019-09-27 21:35:18
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 307 ms / 1,000 ms
コード長 602 bytes
コンパイル時間 13,936 ms
コンパイル使用メモリ 446,604 KB
実行使用メモリ 57,200 KB
最終ジャッジ日時 2024-09-24 20:56:28
合計ジャッジ時間 19,911 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
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