# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167416 | GioChkhaidze | Bomb (IZhO17_bomb) | C++14 | 570 ms | 121668 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>
#define Tree int h,int l,int r
#define Left 2*h,l,(l+r)/2
#define Right 2*h+1,(l+r)/2+1,r
#define F first
#define S second
using namespace std;
const int N=2505;
int n,m,width=1e9,length=1e9,last,D[N][N],Dr[N][N],X,Y;
string s[N],S;
vector < pair < int , pair < int , int > > > v;
inline bool check(int x,int y) {
for (int i=0; i<=n; i++)
for (int j=0; j<=m; j++)
Dr[i][j]=0;
for (int i=0; i<n; i++)
for (int j=0; j<m; j++)
if (D[i+x][j+y]-D[i][j+y]-D[i+x][j]+D[i][j]==0 && s[i][j]=='1')
Dr[i+1][j+1]=Dr[i][j+1]+Dr[i+1][j]-Dr[i][j]+1;
else
Dr[i+1][j+1]=Dr[i][j+1]+Dr[i+1][j]-Dr[i][j];
for (int i=1; i<=n; i++)
for (int j=1; j<=m; j++)
if (s[i-1][j-1]=='1') {
X=max(i-x,0),Y=max(j-y,0);
if (Dr[i][j]-Dr[i][Y]-Dr[X][j]+Dr[X][Y]==0) return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |