# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
523575 | RaresFelix | Chessboard (IZhO18_chessboard) | C++17 | 952 ms | 4980 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <climits>
#include <tuple>
#include <vector>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define MN 167171
using namespace std;
using ll = long long;
ll n, k;
tuple<int, int, int, int> R[MN];
ll P[MN], D[MN];
ll P2[MN], D2[MN];
static inline ll calc(ll a, ll b, ll l) {
if(P[a] == 0 && P[b] == 0)
return ((D[a] * D[b] + 1) >> 1) * l * l;
if(P[a]) {
ll nrseg;
if((D[a] & 1) == 0) {
if(P2[b] <= l) nrseg = D2[b] * l + P2[b];
else nrseg = (D2[b] + 1) * l;
} else {
if(P2[b] <= l) nrseg = D2[b] * l;
else nrseg = (D2[b] - 1) * l + P2[b];
}
return calc(a - P[a], b, l) + P[a] * nrseg;
}
return calc(b, a, l);
}
# | 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... |