結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー mbanmban
提出日時 2017-01-04 03:29:31
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,172 bytes
コンパイル時間 3,427 ms
コンパイル使用メモリ 102,680 KB
実行使用メモリ 27,204 KB
最終ジャッジ日時 2023-08-22 11:26:03
合計ジャッジ時間 7,211 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
27,204 KB
testcase_01 AC 58 ms
22,688 KB
testcase_02 AC 57 ms
22,700 KB
testcase_03 AC 58 ms
22,832 KB
testcase_04 AC 57 ms
20,648 KB
testcase_05 AC 57 ms
22,828 KB
testcase_06 AC 56 ms
20,792 KB
testcase_07 AC 57 ms
20,660 KB
testcase_08 AC 57 ms
18,684 KB
testcase_09 AC 58 ms
20,728 KB
testcase_10 AC 57 ms
20,884 KB
testcase_11 AC 57 ms
20,796 KB
testcase_12 AC 58 ms
20,660 KB
testcase_13 AC 58 ms
22,768 KB
testcase_14 AC 57 ms
20,720 KB
testcase_15 AC 58 ms
22,736 KB
testcase_16 AC 58 ms
22,752 KB
testcase_17 AC 57 ms
20,764 KB
testcase_18 AC 58 ms
22,772 KB
testcase_19 AC 56 ms
20,804 KB
testcase_20 AC 216 ms
20,792 KB
testcase_21 AC 85 ms
22,736 KB
testcase_22 TLE -
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;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;


class Magatro
{
    static void Main()
    {
        int L, H;
        string[] s = Console.ReadLine().Split(' ');
        L = int.Parse(s[0]);
        H = int.Parse(s[1]);
        int rootH = (int)Math.Sqrt(H);
        int ans = 0;
        int max=0;
        for(int i = 2; i <= rootH; i++)
        {
            for(int j = i; j <= H / i; j++)
            {
                if (i * j < L)
                {
                    continue;
                }
                int mins = MinSoinsu(i * j);
                if (max <= mins)
                {
                    max = mins;
                    ans = i * j;
                }
            }
        }
        Console.WriteLine(ans);
    }
    static int MinSoinsu(int n)
    {
        if (n % 2 == 0)
        {
            return 2;

        }
        for(int i = 3; i <= Math.Sqrt(n); i += 2)
        {
            if (n % i == 0)
            {
                return i;
            }
        }
        return n;
    }
}

0