# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
684227 | mychecksedad | Chessboard (IZhO18_chessboard) | C++17 | 2025 ms | 5064 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 int ll;
#define pb push_back
#define all(x) x.begin() x.end()
#define MOD (1e9+7)
const int N = 1e6;
ll n, k, ans = 1e18;
vector<array<ll, 4>> vv;
ll wh(ll x, ll y, ll d){
x++, y++;
if(x <= 0 || y <= 0) return 0;
ll res = (x / d) * (y / d) / 2 * d * d;
if(x % (2*d) >= d){
ll y1 = y / (2*d) * 2*d;
res += y1 / (2*d) * (x % d) * d;
res += (x % d) * min(d, y % (2*d));
}else{
ll y1 = y / (2*d) * 2*d;
res += y1 / (2*d) * (x % d) * d;
}
if(y % (2*d) >= d){
ll x1 = x / (2*d) * 2*d;
res += x1 / (2*d) * (y % d) * d;
res += (y % d) * min(d, x % (2*d));
}else{
ll x1 = x / (2*d) * 2*d;
res += x1 / (2*d) * (y % d) * d;
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... |