QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#864248#9679. 盒子L_Hospital_#0 347ms120860kbC++14593b2025-01-20 12:51:452025-01-20 12:51:46

Judging History

你现在查看的是最新测评结果

  • [2025-01-20 12:51:46]
  • 评测
  • 测评结果:0
  • 用时:347ms
  • 内存:120860kb
  • [2025-01-20 12:51:45]
  • 提交

answer

#include<bits/stdc++.h>
# define int long long
# define rep(i, j, k) for (signed i = j; i <= k; ++i)
# define N 5000100
# define mod 998244353
using namespace std;

int l, r, B, dp[N + 5], tmp[N + 5], ans[N + 5];
signed main()
{
	ios::sync_with_stdio(false); cin.tie(0), cout.tie(0);
	cin >> l >> r >> B;
	dp[1] = ans[1] = 1;
	while (B--)
	{
		rep(i, 1, N) tmp[i] = dp[i - 1] + dp[i + 1];
		rep(i, 1, (N >> 1)) for (int j = 2; i * j <= N; ++j) tmp[i * j] += dp[i];
		rep(i, 1, N) ans[i] += (dp[i] = tmp[i] % mod);
	}
	rep(i, l, r) cout << ans[i] % mod << ' ';
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 334ms
memory: 120860kb

input:

3
5 2 4 3
2 2 1 2 2
4 2 4 3
2 4 1 1
10 3 5 1
2 2 2 2 1 1 1 10 2 2

output:

4 5 3 

result:

wrong answer 1st numbers differ - expected: '7', found: '4'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #35:

score: 0
Wrong Answer
time: 347ms
memory: 120712kb

input:

66664
7 2 82188055 1
35930054 4923258 36288509 46890418 53350617 49812938 68015568
10 2 460335201 1
305598063 240803174 36008172 416771728 391050572 270293987 333994588 436573185 216917970 103343453
9 3 119910901 1
35106715 29444257 72409421 49339248 23617992 3266647 38704192 75874356 72979434
10 1 ...

output:


result:

wrong answer Answer contains longer sequence [length = 66664], but output contains 0 elements

Subtask #5:

score: 0
Skipped

Dependency #1:

0%