結果
| 問題 | No.894 二種類のバス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-28 11:22:24 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 1,000 ms |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 1,861 ms |
| コンパイル使用メモリ | 81,772 KB |
| 実行使用メモリ | 41,852 KB |
| 最終ジャッジ日時 | 2026-04-18 02:26:55 |
| 合計ジャッジ時間 | 3,987 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
import java.math.BigInteger;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
BigInteger T = scanner.nextBigInteger(), A = scanner.nextBigInteger(), B = scanner.nextBigInteger();
scanner.close();
System.out.print(BigInteger.ONE.add(T.subtract(BigInteger.ONE).divide(A)).add(T.subtract(BigInteger.ONE).divide(B)).subtract(T.subtract(BigInteger.ONE).divide(A.multiply(B).divide(A.gcd(B)))));
}
}