# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
574620 | penguinhacker | 힘 센 거북 (IZhO11_turtle) | C++14 | 243 ms | 12108 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN=3e5;
int n, m, k, t, z, cnt[2*mxN+1];
ar<int, 2> cells[22];
vector<ar<int, 2>> pf;
ll f[2*mxN+1], iF[2*mxN+1], ways[22][22], dp1[22], dp2[22][22];
vector<ar<int, 2>> ans_set;
ll bp(ll b, int p, int M) {
ll r=1;
for (; p; p/=2, b=b*b%M)
if (p%2)
r=r*b%M;
return r;
}
ll C(int a, int b, ar<int, 2> prime, int pp) {
assert(0<=b&&b<=a&&a<=n+m);
int pwr=cnt[a]-cnt[b]-cnt[a-b];
assert(pwr>=0);
if (pwr>=prime[1])
return 0;
ll r=f[a]*iF[b]%pp*iF[a-b]%pp;
while(pwr--)
r=r*prime[0]%pp;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |