QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#864244 | #9680. 数字变换 | L_Hospital_# | 6 | 6824ms | 85468kb | C++14 | 613b | 2025-01-20 12:45:33 | 2025-01-20 12:45:37 |
Judging History
answer
#include<bits/stdc++.h>
# define int long long
# define rep(i, j, k) for (signed i = j; i <= k; ++i)
# define N 5001000
# 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 += i) tmp[j] += dp[i];
rep(i, 1, N) dp[i] = tmp[i] % mod;
rep(i, l, r) ans[i] += dp[i];
}
rep(i, l, r) cout << ans[i] % mod << ' ';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 6
Accepted
Test #1:
score: 6
Accepted
time: 513ms
memory: 83172kb
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: 1672ms
memory: 83812kb
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: 183ms
memory: 82144kb
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: 1914ms
memory: 81892kb
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: 18
Accepted
time: 6743ms
memory: 85468kb
input:
970000 1000000 40
output:
503190413 403501814 423543367 667735332 309717676 941521375 469059575 651585751 638081530 319769570 829344038 710448046 491906657 837995934 191992080 435477208 965318020 224310119 82608430 311469551 397529653 845900371 993051834 218739898 720518121 555742487 850145833 86074414 994934100 233037792 83...
result:
ok 30001 numbers
Test #6:
score: 18
Accepted
time: 6824ms
memory: 84444kb
input:
961235 991235 40
output:
726112142 872781888 864415992 271278585 161740406 328072996 78782063 87302065 34440839 496440232 20023252 186342396 764720954 729734275 738722871 935566953 929337897 876835483 50567341 207158528 584651187 436141466 570964468 351740029 722550019 982425596 33848740 853163527 651698124 526627241 675694...
result:
ok 30001 numbers
Test #7:
score: 0
Time Limit Exceeded
input:
222672 252672 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%