# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19527 | Namnamseo | Σ (kriii4_P2) | C++14 | 25 ms | 1716 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 <iostream>
using namespace std;
typedef long long ll;
int M=int(1e9)+7;
ll pow(ll a,ll b){
if(b==0) return 1;
ll ret=pow(a,b/2);
ret=(ret*ret)%M;
if(b&1) ret=(ret*a)%M;
return ret;
}
int main()
{
ll ret=0, tmp;
int n;
cin>>n;
int a,b;
for(;n--;){
cin>>a>>b;
tmp=b*pow(a,M-2)%M;
ret=(ret+tmp)%M;
}
cout<<ret;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |