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 "mosaic.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vi = vector<int>;
#define sz(x) int((x).size())
vl mosaic(vi X, vi Y, vi T, vi B, vi L, vi R) {
int Q = sz(T);
vl C(Q, 0);
vector<vi> vals(sz(X), vi(sz(Y), 0));
for(int i = 0; i < sz(X); i++){
vals[0][i] = X[i];
}
for(int j = 0; j < sz(Y); j++){
vals[j][0] = Y[j];
}
for(int i = 1; i < sz(X); i++){
for(int j = 1; j < sz(Y); j++){
vals[i][j] = (1^(vals[i-1][j]|vals[i][j-1]));
}
}
for(int q = 0; q < sz(T); q++){
for(int i = T[q]; i <= B[q]; i++){
for(int j = L[q]; j <= R[q]; j++){
C[q] += vals[i][j];
}
}
}
return C;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |