結果

問題 No.106 素数が嫌い!2
ユーザー 👑 CleyL
提出日時 2020-03-11 03:31:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 172 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 63,868 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-11-15 23:54:21
合計ジャッジ時間 1,285 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include <iostream>
using namespace std;
int e[2000001],a,n,k,i,j;
main(){
	cin>>n>>k;
	for(i=2;n>=i;i++,a+=k<=e[i]+!e[i])for(j=i;n>=j&&!e[i];j+=i)e[j]++;
	cout<<a<<endl;
}
0