# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19364 | sys7961 | Σ (kriii4_P2) | C++14 | 7 ms | 1084 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>
const long long M = 1000000007;
long long pow(long long n, long long b) {
if (b == 0) {
return 1;
}
long long temp = pow(n, b / 2);
if (b % 2 == 1) {
return temp*temp%M*n%M;
}
return temp*temp%M;
}
int main() {
int m;
scanf("%d", &m);
long long ans = 0;
for (int i = 0; i < m; i++) {
long long n, s;
scanf("%lld%lld", &n, &s);
ans += s*pow(n, M - 2);
ans %= M;
}
printf("%lld", ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |