結果

問題 No.312 置換処理
ユーザー bayashiko_rbayashiko_r
提出日時 2019-01-06 17:02:18
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 102,400 KB
実行使用メモリ 17,792 KB
最終ジャッジ日時 2024-05-03 03:16:11
合計ジャッジ時間 3,276 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 22 ms
17,536 KB
testcase_02 AC 35 ms
17,664 KB
testcase_03 AC 21 ms
17,408 KB
testcase_04 AC 22 ms
17,664 KB
testcase_05 AC 22 ms
17,280 KB
testcase_06 WA -
testcase_07 AC 26 ms
17,664 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 23 ms
17,280 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 22 ms
17,408 KB
testcase_23 AC 22 ms
17,280 KB
testcase_24 AC 22 ms
17,536 KB
testcase_25 AC 22 ms
17,408 KB
testcase_26 AC 22 ms
17,664 KB
testcase_27 AC 22 ms
17,280 KB
testcase_28 AC 22 ms
17,408 KB
testcase_29 AC 21 ms
17,280 KB
testcase_30 AC 22 ms
17,408 KB
testcase_31 WA -
testcase_32 AC 23 ms
17,408 KB
testcase_33 AC 26 ms
17,536 KB
testcase_34 AC 25 ms
17,408 KB
testcase_35 AC 22 ms
17,536 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 22 ms
17,664 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 22 ms
17,280 KB
testcase_43 AC 22 ms
17,664 KB
testcase_44 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program {
    static void Main(string[] args) {
        //入力
        ulong N = ulong.Parse(Console.ReadLine());

        //回答となる数字
        ulong ans = 2;

        //Nの約数を調べていく
        if (N % 2 == 0) {
            ans = N / 2;
        } else {
            for (ulong i = 3; i <= Math.Sqrt(N); i++) {
                if (N % i == 0) {
                    ans = i;
                    break;
                }
            }
        }
        
        if (ans == 2) {
            ans = N;
        }

        //出力
        Console.WriteLine(ans);
    }
}
0