結果

問題 No.644 G L C C D M
ユーザー pazzle1230pazzle1230
提出日時 2018-02-02 21:54:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,011 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 92,432 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-30 02:09:40
合計ジャッジ時間 2,048 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 2 ms
4,468 KB
testcase_03 AC 3 ms
4,380 KB
testcase_04 AC 3 ms
4,496 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 3 ms
4,384 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 3 ms
4,380 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 3 ms
4,384 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 3 ms
4,376 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 3 ms
4,384 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 4 ms
4,380 KB
testcase_26 AC 3 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <complex>
using namespace std;

#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
using ll = long long;
using PII = pair<int, int>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const ll mod = 1e9+7;
ll fact[114514];

int main(void){
	ll N, M;
	fact[0] = 1;
	cin >> N >> M;
	FOR(i, 1, 114514){
		fact[i] = fact[i-1]*i%mod;
	}
	ll res = 0;
	FOR(i, 1, N+1){
		if(i%M) continue;
		res += (N/M-1)*fact[N-2]%mod;
		res %= mod;
	}
	cout << res << endl;
}
0