結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー HimatsubushinHimatsubushin
提出日時 2016-05-31 09:30:31
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 977 bytes
コンパイル時間 1,029 ms
コンパイル使用メモリ 103,296 KB
実行使用メモリ 23,040 KB
最終ジャッジ日時 2024-04-16 19:13:28
合計ジャッジ時間 4,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

using System;

namespace No371
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] data = Console.ReadLine().Split(' ');
            int l = int.Parse(data[0]);
            int h = int.Parse(data[1]);

            int primeSmallNumber;
            int smallFactor = 0;
            int targetNumber = l;

            for (int i = l; i <= h; i++)
            {
                primeSmallNumber = SearchPrimeNumber(i);
                if (smallFactor <= primeSmallNumber)
                {
                    smallFactor = primeSmallNumber;
                    targetNumber = i;
                }
            }

            Console.WriteLine(targetNumber);
        }

        static int SearchPrimeNumber(int number)
        {
            int i = 0;

            for (i = 2; i < number; i++)
                if (number % i == 0)
                    break;

            if (i == number) i = 0;

            return i;
        }
    }
}
0