結果
問題 | No.736 約比 |
ユーザー |
![]() |
提出日時 | 2018-10-10 01:36:16 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 895 bytes |
コンパイル時間 | 907 ms |
コンパイル使用メモリ | 115,888 KB |
実行使用メモリ | 27,708 KB |
最終ジャッジ日時 | 2024-10-12 17:09:24 |
合計ジャッジ時間 | 4,809 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;using System.Linq;class No736{static void Main(){var length = Int32.Parse(Console.ReadLine());var line = Console.ReadLine().Split(' ').Select(x=>Int64.Parse(x));var num = line.OrderBy(x => x).ToArray();long n = 0;for (int i = 0; i < length - 1; ++i){var m = num[i + 1];n = n == 0 ? num[i] : n;while (true){var temp = m % n;if (temp == 0) break;else{m = n;n = temp;}}}var la = line.Select(x => x / n).ToArray();for (int i = 0; i < length; ++i){Console.Write(la[i]);if (i != length - 1) Console.Write(":");else Console.WriteLine();}}}