# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
377602 | SeDunion | Chessboard (IZhO18_chessboard) | C++17 | 894 ms | 4460 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>
#ifndef LOCAL
#define cerr if(false)cerr
#endif // LOCAL
using namespace std;
using ll = long long;
const int N = 1e6 + 66;
#define y1 slkdjflkjsdlfkjlskjfjklkdjslfjslkdjflkjlsdkjflkjslkdjflkdslfkjsldklkjsdjfntnfj
#define y0 alsjdljrktnmndfdfgjhkjhdkfjgbtnmbmfhkjgdkjfhkjxhkjhgtgbhhdjbhjhtdbjbhjhtbhbgbb
int x0[N], y0[N], x1[N], y1[N], n, k;
ll cnt(int d, int x, int y) {
if (x < 0 || y < 0) return 0;
int X = x / d, Y = y / d;
if (0) {
ll cur = 0;
for (int i = 0 ; i < X * d ; ++ i) {
for (int j = 0 ; j < Y * d ; ++ j) {
if ((i / d + j / d) % 2 == 0) cur++;
}
}
return cur;
}
cerr << d << " : " << x << " " << y << " " << X << " " << Y << endl;
ll cur = ((X * 1ll * Y + 1) / 2) * d * d;
ll Xc = Y % 2 == 1 ? X / 2 : (X + 1) / 2;
ll Yc = X % 2 == 1 ? Y / 2 : (Y + 1) / 2;
cur += Xc * d * (y - Y * d + 1);
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... |