結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー mizzsig
提出日時 2016-12-01 10:47:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 63,516 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-11-27 15:27:59
合計ジャッジ時間 46,693 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 13 WA * 7 TLE * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
	long long l, h;
	cin >> l >> h;

	long long ans;
	long long so = 0;
	if(l % 2 == 0){
		l++;
	}
	for(long long i = l; i <= h; i += 2){
		for(long long j = 2; j < i; j++){
			if(i % j == 0){
				if(so < j){
					ans = i;
					so = j;
				}
				break;
			}
		}
	}

	cout << ans << endl;

	return 0;
}
0