QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864251#9680. 数字变换L_Hospital_#6 1998ms120844kbC++14593b2025-01-20 12:53:392025-01-20 12:53:40

Judging History

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

  • [2025-01-20 12:53:40]
  • 评测
  • 测评结果:6
  • 用时:1998ms
  • 内存:120844kb
  • [2025-01-20 12:53:39]
  • 提交

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;
}

详细

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 589ms
memory: 120844kb

input:

1 10 3

output:

4 10 11 13 14 16 15 18 19 16 

result:

ok 10 numbers

Test #2:

score: 6
Accepted
time: 1781ms
memory: 120756kb

input:

1 10 10

output:

1446 3555 5399 8364 9365 13867 13268 18455 18559 22035 

result:

ok 10 numbers

Test #3:

score: 6
Accepted
time: 190ms
memory: 120740kb

input:

1 10 1

output:

1 2 1 1 1 1 1 1 1 1 

result:

ok 10 numbers

Test #4:

score: 6
Accepted
time: 1998ms
memory: 120808kb

input:

4 9 10

output:

8364 9365 13867 13268 18455 18559 

result:

ok 6 numbers

Subtask #2:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Test #5:

score: 0
Time Limit Exceeded

input:

970000 1000000 40

output:


result:


Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Runtime Error

Test #11:

score: 0
Runtime Error

input:

3000000000 3000000000 4

output:


result:


Subtask #5:

score: 0
Skipped

Dependency #3:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%