# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1246704 | 2008 | Mosaic (IOI24_mosaic) | C++20 | 0 ms | 0 KiB |
#include "mosaic.h"
using namespace std;
#include <vector>
std::vector<long long> mosaic(std::vector<int> X, std::vector<int> Y,
std::vector<int> T, std::vector<int> B,
std::vector<int> L, std::vector<int> R) {
int Q = (int)T.size();
int N = (int)X.size();
int mosaic[N][N];
int countBLACK[N][N];
countBLACK[0][0] = X[0];
vector<long long> C(Q, 0);
int size;
for (int i=0; i<Q; i++) {
size=(B[i]-T[i]+1)(R[i]-L[i]+1);
if (size%2==0) {
C[i] == size/2;
} else () {
if ((T[i]+L[i])%2==0) {
C[i] == (size+1)/2;
} else {
C[i] == (size-1)/2;
}
}
}
return C;
}