Submission #2207

#TimeUsernameProblemLanguageResultExecution timeMemory
2207jwvg0425생일수 II (GA4_birthday2)C++98
10 / 100
1000 ms1324 KiB
#include<stdio.h> int x,y; int num[8]; int NumTo() { int n=0,i,j=1; for(i=0;num[i]!=0;i++,j*=10) { n=n+j*num[i]; } return n; } void add2(int idx) { if(num[idx]==8) { num[idx]=3; add2(idx+1); } else if(num[idx]==5)num[idx]=8; else if(num[idx]==3)num[idx]=5; else if(num[idx]==0)num[idx]=3; } void add() { add2(0); } int main() { int i=0,a,b=0; long long int s=0; scanf("%d %d",&x,&y); a=x; for(;x;x/=10) { num[i++]=x%10; } i=0; for(;b!=y;) { add(); b=NumTo(); s=(s+(long long int)a*b)%19980305; a=b; } printf("%lld",s); }
#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...