結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー kapokapo
提出日時 2016-08-05 23:02:45
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 1,065 bytes
コンパイル時間 852 ms
コンパイル使用メモリ 80,316 KB
実行使用メモリ 23,068 KB
最終ジャッジ日時 2024-12-15 21:59:33
合計ジャッジ時間 6,223 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
22,832 KB
testcase_01 AC 130 ms
22,704 KB
testcase_02 AC 129 ms
22,860 KB
testcase_03 AC 133 ms
22,864 KB
testcase_04 AC 128 ms
22,948 KB
testcase_05 AC 128 ms
22,968 KB
testcase_06 AC 136 ms
23,068 KB
testcase_07 AC 131 ms
22,964 KB
testcase_08 AC 128 ms
22,908 KB
testcase_09 AC 128 ms
22,844 KB
testcase_10 AC 129 ms
22,912 KB
testcase_11 AC 130 ms
22,844 KB
testcase_12 AC 136 ms
22,904 KB
testcase_13 AC 135 ms
22,968 KB
testcase_14 AC 138 ms
22,924 KB
testcase_15 AC 130 ms
22,864 KB
testcase_16 AC 134 ms
22,976 KB
testcase_17 AC 135 ms
22,816 KB
testcase_18 AC 131 ms
22,856 KB
testcase_19 AC 134 ms
23,020 KB
testcase_20 AC 130 ms
22,896 KB
testcase_21 AC 136 ms
22,928 KB
testcase_22 AC 137 ms
22,900 KB
testcase_23 AC 128 ms
22,880 KB
testcase_24 AC 133 ms
22,904 KB
testcase_25 AC 137 ms
22,968 KB
testcase_26 AC 129 ms
22,892 KB
testcase_27 AC 131 ms
22,880 KB
testcase_28 AC 132 ms
22,940 KB
testcase_29 AC 132 ms
22,732 KB
testcase_30 AC 126 ms
22,904 KB
testcase_31 AC 134 ms
22,888 KB
testcase_32 AC 133 ms
22,928 KB
testcase_33 AC 138 ms
22,868 KB
testcase_34 AC 144 ms
22,936 KB
testcase_35 AC 133 ms
22,824 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