結果
| 問題 |
No.1059 素敵な集合
|
| コンテスト | |
| ユーザー |
marurunn11
|
| 提出日時 | 2020-05-22 23:12:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,131 bytes |
| コンパイル時間 | 1,928 ms |
| コンパイル使用メモリ | 189,112 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-05 20:42:14 |
| 合計ジャッジ時間 | 2,724 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 2 WA * 17 |
ソースコード
#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
//#include <intrin.h> //AtCoder (gcc) 上ではこれがあると動かない。__popcnt用のincludeファイル。
using namespace std;
typedef long long ll;
typedef long double ld;
#define int long long
#define rep(i, n) for(long long i = 0; i < (n); i++)
#define sqrt(d) pow((long double) (d), 0.50)
const int INF = 2000000000; //2e9
const long long INF2 = 8000000000000000000; //8e18
const int large_P = 1000000007; //1e9 + 7
//const int large_P = 1000000009; //1e9 + 9
//const int large_P = 998244353;
signed main() {
int L, R;
cin >> L >> R;
int N = R - L + 1;
int res = 0;
vector<bool> remain(N, true);
int false_count = 0;
if (L == 1) {
res = 0;
}
else {
rep(i, N) {
if (!remain.at(i)) continue;
else {
int j = 1;
while ((i + L) * (j + 1) <= R) {
if (remain.at((i + L) * (j + 1) - L)) {
false_count++;
}
remain.at((i + L) * (j + 1) - L) = false;
j++;
}
}
}
rep(i, N) {
if (remain.at(i)) res++;
}
res--;
}
cout << res << endl;
//rep(i, N) if (remain.at(i)) cout << i + L << endl;
}
marurunn11