結果

問題 No.414 衝動
ユーザー mbanmban
提出日時 2016-10-12 03:53:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 38 ms / 1,000 ms
コード長 657 bytes
コンパイル時間 849 ms
コンパイル使用メモリ 113,024 KB
実行使用メモリ 28,104 KB
最終ジャッジ日時 2024-04-27 08:27:37
合計ジャッジ時間 2,265 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
23,628 KB
testcase_01 AC 24 ms
21,556 KB
testcase_02 AC 24 ms
23,728 KB
testcase_03 AC 24 ms
23,532 KB
testcase_04 AC 23 ms
22,072 KB
testcase_05 AC 38 ms
25,936 KB
testcase_06 AC 35 ms
23,984 KB
testcase_07 AC 23 ms
23,920 KB
testcase_08 AC 35 ms
25,804 KB
testcase_09 AC 24 ms
23,856 KB
testcase_10 AC 24 ms
23,764 KB
testcase_11 AC 32 ms
23,784 KB
testcase_12 AC 36 ms
28,104 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;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Magatro
{
static void Main()
    {
        long m = long.Parse(Console.ReadLine());

        int rootm;
        if (m > 1000000)
        {
            rootm = 1000000;
        }
        else
        {
            rootm = (int)m-1;
        }
        if (m == 1)
        {
            Console.WriteLine("1 1");
return;
        }
        for(int i = rootm; i >= 1; i--)
        {
            if (m % i == 0)
            {
                Console.WriteLine(i + " " + m / i);
                return;
            }
        }
    }
   

}


0