結果

問題 No.645 Count Permutation
ユーザー hogethoget
提出日時 2018-02-02 22:52:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,181 bytes
コンパイル時間 1,446 ms
コンパイル使用メモリ 165,168 KB
実行使用メモリ 58,344 KB
最終ジャッジ日時 2023-08-30 02:23:46
合計ジャッジ時間 3,667 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
57,988 KB
testcase_01 WA -
testcase_02 AC 16 ms
58,004 KB
testcase_03 AC 15 ms
58,000 KB
testcase_04 WA -
testcase_05 AC 17 ms
58,060 KB
testcase_06 AC 16 ms
58,112 KB
testcase_07 AC 17 ms
58,084 KB
testcase_08 WA -
testcase_09 AC 16 ms
58,004 KB
testcase_10 AC 16 ms
58,004 KB
testcase_11 AC 17 ms
58,060 KB
testcase_12 AC 17 ms
58,116 KB
testcase_13 AC 17 ms
57,996 KB
testcase_14 AC 16 ms
58,064 KB
testcase_15 WA -
testcase_16 AC 22 ms
58,064 KB
testcase_17 AC 30 ms
58,056 KB
testcase_18 AC 21 ms
58,196 KB
testcase_19 AC 30 ms
58,200 KB
testcase_20 AC 30 ms
58,056 KB
testcase_21 WA -
testcase_22 AC 15 ms
58,068 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 23 ms
58,052 KB
testcase_26 AC 29 ms
58,184 KB
testcase_27 AC 22 ms
58,000 KB
testcase_28 AC 21 ms
57,996 KB
testcase_29 AC 27 ms
58,344 KB
testcase_30 AC 27 ms
58,064 KB
testcase_31 AC 29 ms
58,060 KB
testcase_32 AC 20 ms
58,116 KB
testcase_33 AC 19 ms
57,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	int n,l,r,ans = 0,tmp = 1,dp[100010][70] = {};
	cin >> n >> l >> r;
	dp[0][0] = 1;
	for(int i = 1;i < n;i++){
		for(int j = 1;j < 70;j++) dp[i][j] = (dp[i - 1][j - 1] + (i - 1) * dp[i - 1][j]) % MOD;
	}
	for(int i = 0;;i++){
		if(tmp > r) break;
		if(l <= tmp && tmp <= r) ans = (ans + dp[n - 1][i]) % MOD;
		tmp *= 2;
	}
	cout << ans << endl;
	return 0;
}
0