# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
93415 | mirbek01 | Chessboard (IZhO18_chessboard) | C++11 | 1704 ms | 4320 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;
const int N = 1e5 + 2;
int n, k, a[N], b[N], c[N], d[N];
long long ans = 1e18;
long long white(int n, int m, int x){
int a = n / x, b = m / x;
long long ret = ((a + 1) / 2) * 1ll * ((b + 1) / 2) * 1ll * x * x;
ret += (a / 2) * 1ll * (b / 2) * 1ll * x * x;
if(b % 2 == 0){
ret += ((a + 1) / 2) * 1ll * x * (m - b * x);
} else {
ret += (a / 2) * 1ll * x * (m - b * x);
}
if(a % 2 == 0){
ret += ((b + 1) / 2) * 1ll * x * (n - a * x);
} else {
ret += (b / 2) * 1ll * x * (n - a * x);
}
if((a + b) % 2 == 0)
ret += (n - a * x) * 1ll * (m - b * x);
return ret;
}
long long get(int x){
long long ret, cc = n / x;
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... |