結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー kapokapo
提出日時 2016-08-05 23:02:45
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 161 ms / 1,000 ms
コード長 1,065 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 23,160 KB
最終ジャッジ日時 2023-08-22 04:05:06
合計ジャッジ時間 7,647 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
22,944 KB
testcase_01 AC 160 ms
22,876 KB
testcase_02 AC 151 ms
23,140 KB
testcase_03 AC 152 ms
22,920 KB
testcase_04 AC 153 ms
22,888 KB
testcase_05 AC 153 ms
22,860 KB
testcase_06 AC 151 ms
22,864 KB
testcase_07 AC 151 ms
22,936 KB
testcase_08 AC 151 ms
23,068 KB
testcase_09 AC 153 ms
23,160 KB
testcase_10 AC 152 ms
23,064 KB
testcase_11 AC 151 ms
23,060 KB
testcase_12 AC 151 ms
23,160 KB
testcase_13 AC 152 ms
23,136 KB
testcase_14 AC 155 ms
22,868 KB
testcase_15 AC 154 ms
22,880 KB
testcase_16 AC 154 ms
22,876 KB
testcase_17 AC 155 ms
22,936 KB
testcase_18 AC 159 ms
23,044 KB
testcase_19 AC 159 ms
22,948 KB
testcase_20 AC 160 ms
22,872 KB
testcase_21 AC 155 ms
22,876 KB
testcase_22 AC 156 ms
22,876 KB
testcase_23 AC 156 ms
23,160 KB
testcase_24 AC 156 ms
22,984 KB
testcase_25 AC 157 ms
22,980 KB
testcase_26 AC 157 ms
22,924 KB
testcase_27 AC 154 ms
23,064 KB
testcase_28 AC 159 ms
22,984 KB
testcase_29 AC 153 ms
23,040 KB
testcase_30 AC 154 ms
22,908 KB
testcase_31 AC 153 ms
22,876 KB
testcase_32 AC 161 ms
23,152 KB
testcase_33 AC 160 ms
22,880 KB
testcase_34 AC 160 ms
23,064 KB
testcase_35 AC 157 ms
22,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> V;
typedef vector<vector<int> > VV;
typedef long long ll;
const int inf = 2e9;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

const int maxsize = 5004170;
int p[5004170]; // 22237^2237

int main()
{
	int N, L;
	cin >> N >> L;

	rep(i,2,2237) {
		int t = i;
		while (t+i < maxsize) {
			t += i;
			p[t]++;
		}
	}

	ll ans = 0;
	rep(i,2,maxsize) {
		if (p[i]) continue;
		if (i*(N-1) > L) break;
		ans += L - (i*(N-1)) + 1;
	}
	
	cout << ans << endl;

	return 0;
}
0