# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
19399 | fredldh | Σ (kriii4_P2) | C++98 | 0 ms | 1084 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#define M 1000000007
#define mod(a) ((a)%1000000007)
typedef long long int lld;
lld pow(lld a, lld x) {
if(!x) return 1;
lld P = pow(a, x/2);
if(x&1) return mod(a*mod(P*P));
return mod(P*P);
}
lld inv(lld a) {
return pow(a, M-2);
}
lld div(lld a, lld b) {
return mod(a*inv(b));
}
int main() {
int n;
scanf("%d", &n);
lld res = 0;
for(int i = 0; i < n; ++i) {
int N, S;
scanf("%d%d", &N, &S);
res += div(S, N);
}
printf("%lld\n", res);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |