結果

問題 No.129 お年玉(2)
ユーザー ふう
提出日時 2015-01-16 23:42:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 82,140 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-22 12:19:32
合計ジャッジ時間 2,074 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <map>
#include <list>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <iomanip>
#define INF 1050000000

using namespace std;


int main(void)
{
	long long int n, m;
	long long int a;
	long long int ans = 1;

	cin >> n >> m;
	
	

	a = n - (((n / m) / 1000) * 1000) * m;
	a /= 1000;

	for (int i = 0; i < a; i++) {
		ans *= m - i;
		ans %= 1000000000;
	}
	for (int i = 0; i < a; i++) {
		ans /= a - i;
	}

	cout << ans % 1000000000 << endl;

	return (0);
}
0