Submission #20107

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
201072016-02-25 13:42:13fredldh능력 (kriii4_S)C++98
100 / 100
377 ms392020 KiB
#include<stdio.h>
#define N 5000
#define M 1000000007
//#define mod(a) ((a)%M)
typedef long long int lld;
lld mod(lld a) {
while(a < 0) a += M;
return a % M;
}
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 n;
lld fac[N+1];
lld p[N+1], d[N+1], np[N+1];
lld f1[N+1][N+1], f2[N+1][N+1];
int main() {
scanf("%d", &n);
for(int i = 1; i <= n; ++i) {
scanf("%lld%lld", &p[i], &d[i]);
np[i] = div(pow(10,9)-p[i], pow(10,9));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...