This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
const long long int T=19980305;
long long int ans;
long long int ls[100010];
int l;
bool check(int x)
{
while(x){
if(x%10!=3&&x%10!=5&&x%10!=8)return false;
x/=10;
}
return true;
}
int main()
{
int x,y;
scanf("%d%d",&x,&y);
int i;
for(i=x;i<=y;i++){
if(check(i)){ls[l]=i;l++;}
}
for(i=1;i<l;i++){
ans+=ls[i]*ls[i-1];
ans%=T;
}printf("%lld",ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |