結果
| 問題 | No.894 二種類のバス |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-28 11:22:24 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 60 ms / 1,000 ms |
| + 308µs | |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 1,492 ms |
| コンパイル使用メモリ | 86,088 KB |
| 実行使用メモリ | 45,896 KB |
| 最終ジャッジ日時 | 2026-09-08 05:02:28 |
| 合計ジャッジ時間 | 4,499 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)))));
}
}