# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1024854 | sleepntsheep | Multiplication (BOI24_multiplication) | C11 | 1 ms | 688 KiB |
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>
long long mul(long long a, long long b) {
if(!b)return 0;
long long r=mul(a,b/2);
if(b&1)return (r+r+a)%1000000007;
return (r+r)%1000000007;
}
int main() {
int n; long long a=1,b;
scanf("%d",&n);while(n--)scanf("%lld",&b),a=mul(a,b);
printf("%lld",a);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |