/ Randle /

记录详情

Wrong Answer

/in/foo.cc: In function 'll c(ll, ll)':
/in/foo.cc:23:5: warning: unused variable 'ans' [-Wunused-variable]
  ll ans = ((fact[n]*ni(fact[m]))%mod)*ni(fact[n-m])%mod;
     ^~~
/in/foo.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# 状态 耗时 内存占用
#1 Wrong Answer 4ms 372.0 KiB
#2 Wrong Answer 3ms 368.0 KiB
#3 Wrong Answer 3ms 344.0 KiB
#4 Wrong Answer 3ms 352.0 KiB
#5 Wrong Answer 3ms 368.0 KiB
#6 Wrong Answer 3ms 344.0 KiB
#7 Wrong Answer 5ms 1.223 MiB
#8 Wrong Answer 6ms 1.355 MiB
#9 Wrong Answer 6ms 1.836 MiB
#10 Wrong Answer 5ms 1.227 MiB

代码

#include <stdio.h>
#include <iostream>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
ll fact[200005];
ll quickPow(ll a,ll k){
	ll ret = 1,mc = a;
	while(k!=0){
		if(k&1){
			ret=ret*mc%mod;
			k--;
		}
		k = k/2; 
		mc = mc*mc%mod;
	}
	return ret%mod;
}
ll ni(ll a){
	return quickPow(a,mod-2);
}
ll c(ll n,ll m){
	ll ans = ((fact[n]*ni(fact[m]))%mod)*ni(fact[n-m])%mod;
}
int main(){
	ll n,m;
	cin>>n>>m;
	fact[0] = 1;
	for(int i = 1;i<=n;i++){
		fact[i] = fact[i-1]*i%mod;
	}
	cout<<c(n,m);
	return 0;
}

信息

递交者
类型
递交
题目
电影 T1
题目数据
下载
语言
C++
递交时间
2017-10-15 18:24:43
评测时间
2017-10-15 18:24:43
评测机
分数
0
总耗时
45ms
峰值内存
1.836 MiB