結果
| 問題 | No.802 だいたい等差数列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-17 23:01:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 913 bytes |
| 記録 | |
| コンパイル時間 | 906 ms |
| コンパイル使用メモリ | 112,160 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-07-08 01:43:31 |
| 合計ジャッジ時間 | 4,871 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | WA * 2 TLE * 1 -- * 27 |
ソースコード
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
using namespace std;
const long long int MOD = 1000000007;
//const int MOD = 998244353;
//long long int N, M, K, H, W, L, R;
int N, M, K, H, W, L, R;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> N >> M >> L >> R;
K = M - (N - 1)*L;
if (K < 0) {
cout << 0 << endl;
return 0;
}
vector<int>dp(K + 1);
for (int i = 1; i < N; i++) {
for (int j = K; j >= 0; j--) {
for (int k = R - L; k > 0; k--) {
if (j - k >= 0) {
dp[j] += dp[j - k];
dp[j] %= MOD;
}
}
}
}
cout << dp.back() << endl;
return 0;
}