結果
| 問題 |
No.1059 素敵な集合
|
| コンテスト | |
| ユーザー |
platinum
|
| 提出日時 | 2020-05-22 22:05:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 400 bytes |
| コンパイル時間 | 1,749 ms |
| コンパイル使用メモリ | 169,036 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-05 17:38:17 |
| 合計ジャッジ時間 | 2,387 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 2 WA * 17 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
const int Max_Num=2e5+10;
int main(){
int L, R;
cin >> L >> R;
int num=0;
vector<bool> choose(Max_Num,true);
for(int i=L; i<=R; i++){
if(choose[i]){
num++;
for(int j=2; i*j<=R; j++) choose[i*j]=false;
}
}
cout << num-1 << endl;
return 0;
}
platinum