結果

問題 No.894 二種類のバス
コンテスト
ユーザー firiexp
提出日時 2019-09-27 21:35:18
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
AC  
実行時間 191 ms / 1,000 ms
コード長 602 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,833 ms
コンパイル使用メモリ 470,140 KB
実行使用メモリ 53,240 KB
最終ジャッジ日時 2026-04-12 00:01:05
合計ジャッジ時間 15,692 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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