結果

問題 No.1043 直列大学
ユーザー 夜
提出日時 2021-01-24 18:55:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 993 bytes
コンパイル時間 765 ms
コンパイル使用メモリ 91,688 KB
実行使用メモリ 5,220 KB
最終ジャッジ日時 2023-09-01 22:23:14
合計ジャッジ時間 2,784 ms
ジャッジサーバーID
(参考情報)
judge14 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,212 KB
testcase_01 AC 5 ms
4,848 KB
testcase_02 AC 6 ms
4,840 KB
testcase_03 AC 5 ms
5,084 KB
testcase_04 AC 5 ms
5,008 KB
testcase_05 AC 5 ms
4,920 KB
testcase_06 AC 5 ms
5,204 KB
testcase_07 AC 5 ms
4,912 KB
testcase_08 AC 6 ms
4,848 KB
testcase_09 AC 20 ms
4,956 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 31 ms
5,212 KB
testcase_14 AC 32 ms
5,084 KB
testcase_15 AC 35 ms
4,940 KB
testcase_16 AC 32 ms
4,944 KB
testcase_17 AC 25 ms
5,212 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 27 ms
4,892 KB
testcase_25 AC 30 ms
4,816 KB
testcase_26 AC 32 ms
4,908 KB
testcase_27 WA -
testcase_28 AC 30 ms
5,008 KB
testcase_29 AC 13 ms
4,848 KB
testcase_30 AC 23 ms
4,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long v[110000] = {}, r[110000] = {};
long long const mod = 1000000007;
long long const mx = 100010;
int main() {
	long long n, m, a, b;
	cin >> n >> m;
	v[0] = 1, r[0] = 1;
	for (int i = 0; i < n; i++) {
		int vi;
		cin >> vi;
		for (int j = mx; j >= vi; j--) {
			v[j] += v[j - vi];
			v[j] %= mod;
		}
	}
	for (int i = 0; i < m; i++) {
		int ri;
		cin >> ri;
		for (int j = mx; j >= ri; j--) {
			r[j] += r[j - ri];
			r[j] %= mod;
		}
	}
	cin >> a >> b;
	long long ans = 0;
	for (int i = 1; i < mx; i++) {
		v[i] += v[i - 1];
		v[i] %= mod;
	}
	for (int i = 1; i < mx; i++) {
		ans += r[i] * (v[min(i * b, mx)] - v[min(i * a - 1, mx)]) % mod;
		ans %= mod;
	}
	cout << (ans + mod) % mod << endl;
}
0