結果

問題 No.1059 素敵な集合
ユーザー marurunn11marurunn11
提出日時 2020-05-22 23:12:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,131 bytes
コンパイル時間 2,507 ms
コンパイル使用メモリ 186,932 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 18:38:55
合計ジャッジ時間 2,400 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
6,944 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
6,944 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0