# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
52041 | mrtsima22 | Chessboard (IZhO18_chessboard) | C++17 | 1147 ms | 103384 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;
#define LL long long
const int lmax=1999999999;
const long long lmx=1999999999999999999;
const int N=200004;
int n, k, x1[N], y11[N], x2[N], y2[N];
LL ans;
int pos;
LL gety(LL y,LL she){
if(y <= 0) return 0;
LL res = (y / she) / 2 * she;
if((y / she) & 1) res += y % she + 1;
return res;
}
LL getx(LL x,LL she){
if(x <= 0) return 0;
LL res = (x / she) / 2 * she;
if((x / she) & 1) res += x % she + 1;
return res;
}
void solve(int she){
LL odd = 0, even = 0;
for(int i = 1,xx,yy; i <= k; i++){
LL o1 = gety(y2[i], she) - gety(y11[i] - 1, she);
LL e1 = (y2[i] - y11[i] + 1) - o1;
LL o2 = getx(x2[i], she) - getx(x1[i] - 1, she);
# | 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... |