結果

問題 No.1059 素敵な集合
ユーザー leaf_1415leaf_1415
提出日時 2020-05-22 21:43:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,001 bytes
コンパイル時間 847 ms
コンパイル使用メモリ 80,684 KB
実行使用メモリ 36,608 KB
最終ジャッジ日時 2024-04-15 16:25:48
合計ジャッジ時間 8,447 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 285 ms
36,444 KB
testcase_01 AC 286 ms
36,428 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 285 ms
36,480 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 262 ms
36,400 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

llint l, r;
vector<llint> vec[200005];

llint get(llint l, llint r)
{
	if(vec[r].back() >= l) return 0;
	else return 1;
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> l >> r;
	
	for(int i = 1; i < 200005; i++){
		for(int j = i*2; j < 200005; j+=i){
			vec[j].push_back(i);
		}
	}
	
	llint ans = 0;
	for(int i = r; i >= l+1; i--) ans += get(l, i);
	cout << ans << endl;
	
	return 0;
}
0