# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397021 | tibinyte | The grade (info1cup18_thegrade) | C++14 | 455 ms | 6572 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 <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <bitset>
#include <string>
#include <unordered_map>
#pragma optimize("O2")
#define mod 1000000007
using namespace std;
long long powmod(long long a, long long b, long long p) {
if (b == 0) {
return 1;
}
if (b % 2 == 1) {
return (a * powmod(a, b - 1, p)) % p;
}
long long P = powmod(a, b / 2, p);
return (P * P) % p;
}
long long inv(long long a, long long p) {
return powmod(a, p - 2, p);
}
vector<long long> fact;
long long combs(long long n, long long k, long long p) {
return ((fact[n] * inv(fact[k], p) % p) * inv(fact[n - k] , p)) % p;
}
long long stars_and_bars(long long n, long long k, long long p) {
return combs(n + k - 1, n, p);
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |