Submission #19591

# Submission time Handle Problem Language Result Execution time Memory
19591 2016-02-24T23:02:59 Z pjh0123 Σ (kriii4_P2) C++
0 / 100
6 ms 1084 KB
#include <stdio.h>
#include <string.h>
#include <vector>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#define INFL 90000000000000000
#define PI 3.141592653589793238462643383279502884
#define SQ(a) ((a)*(a))
#define pb push_back
#define mod 1000000007
typedef long long ll;
typedef long double ld;
typedef double dd;
typedef std::pair<int,int> pii;
using namespace std;

ll m,n,s,inv,ans;
ll mpx(ll a, ll x){
	a%=mod;
	ll ret=1;
	while(x){
		if(x%2){
			ret=ret*a%mod;;
			a=a*a%mod;	
		}
		x/=2;
	}
	return ret;
}
int main(){
	ans=1;
	scanf("%lld",&m);
	for(int i=0;i<m;i++){
		scanf("%lld%lld",&n,&s);
		inv = mpx(n,mod-2);
		ans=ans*s%mod*inv%mod;
	}
	printf("%lld",ans);
}
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1084 KB Output isn't correct
2 Halted 0 ms 0 KB -