結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
25,152 KB
testcase_01 AC 57 ms
20,692 KB
testcase_02 AC 57 ms
20,688 KB
testcase_03 AC 57 ms
20,708 KB
testcase_04 AC 56 ms
18,736 KB
testcase_05 AC 57 ms
20,660 KB
testcase_06 AC 57 ms
22,772 KB
testcase_07 AC 57 ms
20,776 KB
testcase_08 AC 57 ms
20,780 KB
testcase_09 AC 58 ms
20,716 KB
testcase_10 AC 57 ms
20,656 KB
testcase_11 AC 57 ms
20,776 KB
testcase_12 AC 57 ms
20,668 KB
testcase_13 AC 59 ms
22,688 KB
testcase_14 AC 59 ms
20,720 KB
testcase_15 AC 64 ms
22,696 KB
testcase_16 AC 59 ms
20,820 KB
testcase_17 AC 58 ms
20,768 KB
testcase_18 AC 56 ms
20,660 KB
testcase_19 AC 57 ms
22,776 KB
testcase_20 TLE -
testcase_21 AC 131 ms
20,656 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()
    {
        long L, H;
        string[] s = Console.ReadLine().Split(' ');
        L = long.Parse(s[0]);
        H = long.Parse(s[1]);
        long rootH = (int)Math.Sqrt(H);
        long ans = 0;
        long max=0;
        for(long i = 2; i <= rootH; i++)
        {
            for(long j = i; j <= H / i; j++)
            {
                if (i * j < L)
                {
                    continue;
                }
                long mins = Math.Min(MinSoinsu(i),MinSoinsu(j));
                if (max <= mins)
                {
                    max = mins;
                    ans = i * j;
                }
            }
        }
        Console.WriteLine(ans);
    }
    static long MinSoinsu(long 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