結果
| 問題 | No.415 ぴょん |
| コンテスト | |
| ユーザー |
samplelpmas
|
| 提出日時 | 2017-04-26 18:33:21 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 54 ms / 1,000 ms |
| + 342µs | |
| コード長 | 454 bytes |
| 記録 | |
| コンパイル時間 | 2,545 ms |
| コンパイル使用メモリ | 85,008 KB |
| 実行使用メモリ | 45,332 KB |
| 最終ジャッジ日時 | 2026-09-25 22:10:04 |
| 合計ジャッジ時間 | 4,846 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
long D = sc.nextLong();
System.out.println(N / gcd(N, D) - 1);
}
private static long gcd(long a, long b) {
while (b > 0) {
long remainder = a % b;
a = b;
b = remainder;
}
return a;
}
}
samplelpmas