# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099885 | model_code | Mosaic (IOI24_mosaic) | C++17 | 1079 ms | 2097152 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.
// incorrect/subtask1.cpp
#include "mosaic.h"
#include "bits/stdc++.h"
using namespace std;
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 n = X.size();
vector<vector<int> > grid(n, vector<int>(n));
vector<vector<bool> > vis(n, vector<bool>(n));
for(int i = 0; i < n; i++) {
grid[0][i] = X[i];
}
for(int i = 0; i < n; i++) {
grid[i][0] = Y[i];
}
for(int i = 1; i < n; i++) {
for(int j = 1; j < n; j++) {
grid[i][j] = !(grid[i-1][j] | grid[i][j-1]);
}
}
vector<long long> ans;
for(int i = 0; i < T.size(); i++) {
int rx = T[i], ry = B[i];
int cx = L[i], cy = R[i];
int cnt = 0;
if(rx<=0&&0<=ry&&cx<=0&&0<=cy) cnt += grid[0][0];
if(rx<=0&&0<=ry&&cx<=1&&1<=cy) cnt += grid[0][1];
if(rx<=1&&1<=ry&&cx<=0&&0<=cy) cnt += grid[1][0];
if(rx<=1&&1<=ry&&cx<=1&&1<=cy) cnt += grid[1][1];
ans.push_back(cnt);
}
return ans;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |