結果
問題 | No.1250 汝は倍数なりや? |
ユーザー | keymoon |
提出日時 | 2020-12-31 21:32:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 794 bytes |
コンパイル時間 | 1,033 ms |
コンパイル使用メモリ | 105,088 KB |
実行使用メモリ | 37,760 KB |
最終ジャッジ日時 | 2024-04-18 03:06:46 |
合計ジャッジ時間 | 5,812 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 27 ms
18,816 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 28 ms
18,816 KB |
testcase_07 | AC | 29 ms
19,072 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 27 ms
18,944 KB |
testcase_12 | WA | - |
testcase_13 | AC | 28 ms
18,944 KB |
testcase_14 | AC | 28 ms
18,816 KB |
testcase_15 | AC | 27 ms
18,688 KB |
testcase_16 | WA | - |
testcase_17 | AC | 28 ms
18,944 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 29 ms
18,816 KB |
testcase_21 | WA | - |
testcase_22 | AC | 28 ms
18,816 KB |
testcase_23 | AC | 32 ms
19,328 KB |
testcase_24 | WA | - |
testcase_25 | AC | 33 ms
19,456 KB |
testcase_26 | AC | 32 ms
19,328 KB |
testcase_27 | WA | - |
testcase_28 | AC | 33 ms
19,328 KB |
testcase_29 | WA | - |
testcase_30 | AC | 32 ms
19,584 KB |
testcase_31 | AC | 32 ms
19,328 KB |
testcase_32 | AC | 31 ms
19,328 KB |
testcase_33 | AC | 125 ms
37,760 KB |
testcase_34 | AC | 77 ms
28,160 KB |
testcase_35 | AC | 114 ms
36,352 KB |
testcase_36 | AC | 118 ms
36,736 KB |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 85 ms
32,896 KB |
testcase_41 | WA | - |
testcase_42 | AC | 64 ms
25,856 KB |
testcase_43 | AC | 118 ms
36,608 KB |
testcase_44 | WA | - |
testcase_45 | AC | 119 ms
36,864 KB |
testcase_46 | AC | 57 ms
23,808 KB |
testcase_47 | WA | - |
testcase_48 | AC | 27 ms
18,944 KB |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Numerics; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using static System.Math; public static class P { public static void Main() { var nh = Console.ReadLine().Split().Select(int.Parse).ToArray(); var n = nh[0]; long h = nh[1]; foreach (var a in Console.ReadLine().Split().Select(int.Parse)) h = GCD(h, a); Console.WriteLine(h == 1 ? "YES" : "NO"); } static long GCD(long a, long b) { while (true) { if (b == 0) return a; a %= b; if (a == 0) return b; b %= a; } } }