結果

問題 No.414 衝動
ユーザー noriocnorioc
提出日時 2016-08-27 14:18:36
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 790 bytes
コンパイル時間 950 ms
コンパイル使用メモリ 110,312 KB
実行使用メモリ 31,476 KB
最終ジャッジ日時 2024-04-26 06:19:58
合計ジャッジ時間 3,782 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,296 KB
testcase_01 AC 23 ms
17,536 KB
testcase_02 AC 22 ms
17,920 KB
testcase_03 AC 28 ms
17,920 KB
testcase_04 AC 23 ms
17,920 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Linq;

class Program {
    static int ReadInt() { return int.Parse(Console.ReadLine()); }
    static int[] ReadInts() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return Console.ReadLine().Split(); }

    static void Calc(long m) {
        if (m % 2 == 0) {
            Console.WriteLine("{0} {1}", 2, m / 2);
            return;
        }

        for (int 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);
    }

    static void Main() {
        long m = long.Parse(Console.ReadLine());
        Calc(m);
    }
}
0