結果
| 問題 | No.894 二種類のバス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-28 11:22:24 |
| 言語 | Java (openjdk 27.0.1.0.3 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 56 ms / 1,000 ms |
| + 466µs | |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 1,559 ms |
| コンパイル使用メモリ | 85,556 KB |
| 実行使用メモリ | 43,060 KB |
| 最終ジャッジ日時 | 2026-10-12 15:19:36 |
| 合計ジャッジ時間 | 4,048 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
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)))));
}
}