結果

問題 No.129 お年玉(2)
ユーザー fal_rnd
提出日時 2017-01-01 13:28:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 1,178 ms
コンパイル使用メモリ 159,420 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-16 04:58:11
合計ジャッジ時間 2,350 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const char en='\n';
const int mod=1000000007;
int main(){
	cin.tie();
	ios::sync_with_stdio(false);

	ll m,p,MOD=1000000000;
	ll r=1;

	cin>>m>>p;
	m=m/1000%p;

	for(int i=p;i>m;i--){
		r*=i;
		r%=MOD;
	}
	for(int i=p-m;i>1;i--){
		r/=i;
		r%=MOD;
	}
	cout<<r<<en;
	return 0;
}
0