結果
| 問題 | No.442 和と積 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-07-28 14:56:01 | 
| 言語 | C# (.NET 8.0.404) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 53 ms / 1,000 ms | 
| コード長 | 537 bytes | 
| コンパイル時間 | 9,052 ms | 
| コンパイル使用メモリ | 165,096 KB | 
| 実行使用メモリ | 186,336 KB | 
| 最終ジャッジ日時 | 2024-10-06 06:26:51 | 
| 合計ジャッジ時間 | 10,865 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (95 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
namespace yukicoder
{
	public class Program
	{
		public static void Main()
		{
			var a = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
			var k = Euclid(a[0] + a[1], a[0]);
			k *= Euclid((a[0] + a[1]) / k, a[1]);
			Console.WriteLine(k);
		}
		static long Euclid(long a, long b)
		{
			var c = Math.Max(a, b);
			var d = Math.Min(a, b);
			var e = c % d;
			if (e > 0)
			{
				return Euclid(e, d);
			}
			else
			{
				return d;
			}
		}
	}
}
            
            
            
        