# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1148755 | sonamoo | 악수 (kriii4_D) | C++20 | 145 ms | 5760 KiB |
#include <bits/stdc++.h>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pii pair<int,int>
#define ll long long int
#define SIZE 500005
#define all(v) v.begin(), v.end()
#define pb push_back
#define MOD 1000000007
#define INF 1000000007
using namespace std;
ll C[888][888] , D[888][888] , comb[888][888] , inv[888];
int main() {
FastIO;
int N , M;
cin >> N;
comb[0][0] = inv[1] = comb[1][0] = comb[1][1] = 1;
for (int i = 2; i < 800; i++) {
comb[i][0] = 1;
for (int j = 1; j <= i; j++) comb[i][j] = (comb[i-1][j-1]+comb[i-1][j])%MOD;
inv[i] = (inv[MOD%i]*(MOD-MOD/i))%MOD;
}
C[1][0] = 1LL; D[1][0] = 1LL;
for (int n = 2; n <= N; n++) {
M = n*(n-1)/2;
for (int k = n-1; k <= M; k++) {
for (int i = 1; i <= n-1; i++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |