Submission #1511

#TimeUsernameProblemLanguageResultExecution timeMemory
1511gs13068생일수 II (GA4_birthday2)C++98
25 / 100
8 ms9136 KiB
#include<cstdio> long long a[1000000],an; void backtracking(long long i,int j) { if(j==0)a[an++]=i; else { backtracking(i*10+3,j-1); backtracking(i*10+5,j-1); backtracking(i*10+8,j-1); } } int main() { long long x,y,before=0,res=0; int i; for(i=1;i<=11;i++)backtracking(0,i); scanf("%lld%lld",&x,&y); for(i=0;i<an;i++) { if(a[i]>=x&&a[i]<=y) { res+=before%19980305*a[i]%19980305; res%=19980305; before=a[i]; } } printf("%lld",res); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...