結果

問題 No.415 ぴょん
ユーザー TatsuDXTatsuDX
提出日時 2016-09-03 17:13:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 294 bytes
コンパイル時間 3,291 ms
コンパイル使用メモリ 73,776 KB
実行使用メモリ 50,272 KB
最終ジャッジ日時 2024-04-29 11:42:57
合計ジャッジ時間 7,830 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
50,056 KB
testcase_01 AC 121 ms
49,348 KB
testcase_02 AC 122 ms
49,680 KB
testcase_03 AC 126 ms
50,020 KB
testcase_04 AC 124 ms
50,068 KB
testcase_05 AC 123 ms
49,652 KB
testcase_06 AC 123 ms
49,700 KB
testcase_07 AC 124 ms
50,056 KB
testcase_08 AC 119 ms
50,268 KB
testcase_09 AC 120 ms
50,144 KB
testcase_10 AC 126 ms
50,272 KB
testcase_11 AC 124 ms
49,680 KB
testcase_12 AC 117 ms
49,736 KB
testcase_13 AC 113 ms
49,756 KB
testcase_14 AC 124 ms
49,960 KB
testcase_15 AC 124 ms
47,604 KB
testcase_16 AC 125 ms
41,208 KB
testcase_17 AC 123 ms
41,156 KB
testcase_18 AC 119 ms
40,364 KB
testcase_19 AC 117 ms
41,584 KB
testcase_20 AC 124 ms
41,052 KB
testcase_21 AC 120 ms
40,844 KB
testcase_22 AC 123 ms
40,956 KB
testcase_23 AC 118 ms
41,044 KB
testcase_24 AC 122 ms
41,084 KB
testcase_25 AC 117 ms
39,796 KB
testcase_26 AC 124 ms
40,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong(), m = sc.nextLong(), a = n, b = m, tmp = n%m;
		while(tmp > 0){
			a = b;
			b = tmp;
			tmp = a % b;
		}
		System.out.println((n/b)-1);
	}
}
0