結果

問題 No.414 衝動
ユーザー 明智重蔵明智重蔵
提出日時 2016-09-09 06:00:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 29 ms / 1,000 ms
コード長 1,191 bytes
コンパイル時間 1,460 ms
コンパイル使用メモリ 110,692 KB
実行使用メモリ 26,008 KB
最終ジャッジ日時 2024-04-27 08:24:56
合計ジャッジ時間 2,211 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,912 KB
testcase_01 AC 24 ms
25,880 KB
testcase_02 AC 24 ms
25,752 KB
testcase_03 AC 29 ms
23,776 KB
testcase_04 AC 24 ms
23,908 KB
testcase_05 AC 29 ms
24,156 KB
testcase_06 AC 29 ms
26,008 KB
testcase_07 AC 24 ms
24,032 KB
testcase_08 AC 27 ms
23,900 KB
testcase_09 AC 29 ms
23,780 KB
testcase_10 AC 24 ms
25,692 KB
testcase_11 AC 24 ms
23,644 KB
testcase_12 AC 24 ms
25,816 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;

//YukiCoder414 衝動
class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("4");
            //2 2
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("18");
            //6 3
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("2");
            //1 2
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        long M = long.Parse(InputList[0]);

        //偶数の場合
        if (M % 2 == 0) {
            Console.WriteLine("{0} {1}", 2, M / 2);
            return;
        }

        for (long I = 3; I * I <= M; I += 2) {
            if (M % I == 0) {
                Console.WriteLine("{0} {1}", I, M / I);
                return;
            }
        }
        Console.WriteLine("{0} {1}", 1, M);
    }
}
0