結果
| 問題 | No.644 G L C C D M |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-03 11:14:01 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 969 bytes |
| 記録 | |
| コンパイル時間 | 31 ms |
| 最終ジャッジ日時 | 2026-03-04 21:44:25 |
| 合計ジャッジ時間 | 509 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
eef47eba6224
[/j_bin/judge_tool judge 40000 ../CompileMemory.txt /dev/null sud /dev/null _ g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out main.cpp]
strconv.Atoi: parsing "../CompileMemory.txt": invalid syntax
goroutine 1 [running]:
runtime/debug.Stack()
/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
/home/yuki2006/gopath/src/yukicoder/judge/main.go:22 +0x57
panic({0x7d6880?, 0xc0000f6240?})
/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132
main.judgeMain({0xc000012150, 0x5?, 0x0?})
/home/yuki2006/gopath/src/yukicoder/judge/judge_linux.go:121 +0x4b1
main.main()
/home/yuki2006/gopath/src/yukicoder/judge/main.go:97 +0x277
ソースコード
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
int N, M;
int dp[100001];
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
cin >> N >> M;
int s = 0, n = N/M;
if (n) {
for (int x=n; x>=1; x--) {
dp[x] = (1LL*(n/x)*(n/x)) % MOD;
for (int k=2; x*k<=n; k++) dp[x] += MOD-dp[x*k], dp[x] %= MOD;
}
s = dp[1]-1;
}
for (int i=1; i<=N-2; i++) s = (1LL*s*i) % MOD;
cout << s << "\n";
return 0;
}