結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー mban
提出日時 2016-08-14 11:13:25
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 791 bytes
コンパイル時間 1,106 ms
コンパイル使用メモリ 107,520 KB
実行使用メモリ 24,448 KB
最終ジャッジ日時 2024-11-07 16:42:00
合計ジャッジ時間 5,021 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16 TLE * 1 -- * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 AB {
    static long T, F;
    static void Main() {
        long[] q = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
        T = q[0];
        F = q[1];
        long max = 0;
        long ans = 0;
        for(long i = T; i <= F; i++) {
            long w = MinInsuu(i);
            if (max <= w) {
                max = w;
                ans = i;
            }
        }
        Console.WriteLine(ans);
    }
    static long MinInsuu(long l) {
        for(int i = 2; true; i++) {
            if (l % i == 0) {
                if (l == i) {
                    return 0;
                }
                else {
                    return i;
                }
            }
        }
    }

}


0