Submission #19526

# Submission time Handle Problem Language Result Execution time Memory
19526 2016-02-24T16:11:21 Z Namnamseo Σ (kriii4_P2) C++14
0 / 100
23 ms 1716 KB
#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=1;
    int n;
    cin>>n;
    int a,b;
    for(;n--;){
        cin>>a>>b;
        ret=(ret*b)%M;
        ret=(ret*pow(a,M-2))%M;
    }
    cout<<ret;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 1716 KB Output isn't correct
2 Halted 0 ms 0 KB -