結果
| 問題 |
No.415 ぴょん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-27 18:48:00 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 1,000 ms |
| コード長 | 313 bytes |
| コンパイル時間 | 903 ms |
| コンパイル使用メモリ | 110,236 KB |
| 実行使用メモリ | 25,944 KB |
| 最終ジャッジ日時 | 2024-11-18 14:44:28 |
| 合計ジャッジ時間 | 2,280 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
}
}