結果

問題 No.415 ぴょん
ユーザー hogekihogeki
提出日時 2016-08-27 18:48:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 1,000 ms
コード長 313 bytes
コンパイル時間 1,957 ms
コンパイル使用メモリ 100,808 KB
実行使用メモリ 24,772 KB
最終ジャッジ日時 2023-08-11 20:24:37
合計ジャッジ時間 4,583 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,668 KB
testcase_01 AC 55 ms
22,784 KB
testcase_02 AC 54 ms
20,852 KB
testcase_03 AC 52 ms
18,656 KB
testcase_04 AC 55 ms
22,668 KB
testcase_05 AC 56 ms
18,664 KB
testcase_06 AC 54 ms
20,688 KB
testcase_07 AC 56 ms
20,752 KB
testcase_08 AC 56 ms
20,776 KB
testcase_09 AC 54 ms
20,796 KB
testcase_10 AC 54 ms
20,724 KB
testcase_11 AC 55 ms
22,716 KB
testcase_12 AC 55 ms
22,728 KB
testcase_13 AC 54 ms
20,788 KB
testcase_14 AC 54 ms
20,860 KB
testcase_15 AC 55 ms
20,792 KB
testcase_16 AC 55 ms
24,772 KB
testcase_17 AC 56 ms
22,852 KB
testcase_18 AC 56 ms
20,692 KB
testcase_19 AC 55 ms
20,724 KB
testcase_20 AC 54 ms
20,688 KB
testcase_21 AC 57 ms
20,864 KB
testcase_22 AC 55 ms
20,768 KB
testcase_23 AC 55 ms
20,756 KB
testcase_24 AC 54 ms
20,772 KB
testcase_25 AC 57 ms
22,796 KB
testcase_26 AC 55 ms
20,788 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Pyon
{
	static void Main(String[] args)
	{
		long N, D;
		String [] vals = Console.ReadLine().Split(' ');

		N = long.Parse(vals[0]);
		D = long.Parse(vals[1]);

		Console.WriteLine(N/gcd(N,D)-1);
	}


	static long gcd(long a, long b)
	{
		if(b == 0)
			return a;

		return gcd(b, a%b);
	}
}
0