QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#874033 | #9680. 数字变换 | Hanghang# | 6 | 1155ms | 26980kb | C++20 | 596b | 2025-01-27 12:15:27 | 2025-01-27 12:15:28 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e6+43,H=9982445353;
ll n,m,L,R,f[N],g[N],ans[N];
inline void Add(ll &x,ll y){x=x+y>=H?x+y-H:x+y;}
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin>>L>>R>>n;m=R+n;f[1]=ans[1]=1;
for(int t=1;t<=n;t++)
{
memcpy(g,f,sizeof(g));memset(f,0,sizeof(f));
for(int i=1;i<=m;i++)if(g[i])
{
if(i>1)Add(f[i-1],g[i]);
if(i<m)Add(f[i+1],g[i]);
for(int j=i+i;j<=m;j+=i)Add(f[j],g[i]);
}
for(int i=1;i<=m;i++)Add(ans[i],f[i]);
}
for(int i=L;i<=R;i++)cout<<ans[i]<<" ";
}
詳細信息
Subtask #1:
score: 6
Accepted
Test #1:
score: 6
Accepted
time: 2ms
memory: 20968kb
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: 8ms
memory: 20328kb
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: 1ms
memory: 20200kb
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: 10ms
memory: 20452kb
input:
4 9 10
output:
8364 9365 13867 13268 18455 18559
result:
ok 6 numbers
Subtask #2:
score: 0
Wrong Answer
Dependency #1:
100%
Accepted
Test #5:
score: 0
Wrong Answer
time: 1155ms
memory: 26980kb
input:
970000 1000000 40
output:
5689803348 9274126361 2467167751 38460016 2937234919 7427413270 9828570583 2739687339 6653824771 9738134783 6139640889 491597751 2306298344 8208468636 7209912158 8298848833 685543707 6887139862 3574728696 5843939372 9782568934 6251372014 3806046840 324173586 9946607512 5780825328 9233279752 25963628...
result:
wrong answer 1st numbers differ - expected: '503190413', found: '5689803348'
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%