| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364455 | vivkostov | Mosaic (IOI24_mosaic) | C++20 | 50 ms | 14536 KiB |
#include "mosaic.h"
#include <bits/stdc++.h>
using namespace std;
struct cell
{
int i1,j1,i2,j2;
};
int n,q,a[200005],b[200005],c[200005],d[200005],mat[50][50];
cell g[200005];
vector<long long int>otg;
void dumb()
{
for(int i=1;i<n;i++)
{
for(int j=1;j<n;j++)
{
mat[i][j]=((mat[i-1][j]|mat[i][j-1])^1);
}
}
int br=0;
for(int z=1;z<=q;z++)
{
br=0;
for(int i=g[z].i1;i<=g[z].i2;i++)
{
for(int j=g[z].j1;j<=g[z].j2;j++)
{
br+=mat[i][j];
}
}
otg.push_back(br);
}
}
vector<long long> mosaic(vector<int> X,vector<int> Y,vector<int> T,vector<int> B,vector<int> L,vector<int> R)
{
n=X.size();
q=T.size();
for(int i=0;i<q;i++)
{
g[i+1].i1=T[i];
g[i+1].i2=B[i];
g[i+1].j1=L[i];
g[i+1].j2=R[i];
}
if(n<=3)
{
for(int i=0;i<n;i++)
{
mat[0][i]=X[i];
}
for(int i=0;i<n;i++)
{
mat[i][0]=Y[i];
}
dumb();
return otg;
}
c[1]=((X[1]|Y[1])^1);
d[1]=c[1];
for(int i=2;i<n;i++)
{
c[i]=((c[i-1]|X[i])^1);
d[i]=((d[i-1]|Y[i])^1);
}
a[2]=((c[2]|d[2])^1);
b[2]=a[2];
for(int i=3;i<n;i++)
{
}
}
Compilation message (stderr)
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
