# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109887 | vjudge1 | Magneti (COCI21_magneti) | C++14 | 33 ms | 12872 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 55, MAXL = 1e4 + 505, Mod = 1e9 + 7;
inline void UP(int &x, ll y) {x = (y + x) % Mod;}
int n, l, w[MAXN];
int ans;
int f[MAXN][MAXN][MAXL];
int fac[MAXL], ifc[MAXL], inv[MAXL];
void Fac() {
fac[0] = ifc[0] = fac[1] = ifc[1] = inv[1] = 1;
for (int i = 2; i < MAXL; ++i) {
fac[i] = 1LL * fac[i - 1] * i % Mod;
inv[i] = -1LL * inv[Mod % i] * (Mod / i) % Mod;
ifc[i] = 1LL * ifc[i - 1] * inv[i] % Mod;
}
return ;
}
inline int C(int n, int m) {
if (n < 0 || m < 0 || m > n) return 0;
return 1LL * fac[n] * ifc[m] % Mod * ifc[n - m] % Mod;
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |