# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
345372 |
2021-01-07T08:03:47 Z |
pragmatist |
UFO (IZhO14_ufo) |
C++14 |
|
106 ms |
4680 KB |
// turmak-_-
#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define sz(a) a.size()
#define nl "\n"
#define IOI return 0;
#define pb push_back
#define ppb pop_back()
#define ll long long
#define ull unsigned long long
#define ld long double
#define IOS ios_base :: sync_with_stdio(NULL); cin.tie(0); cout.tie(0);
#define pii pair<int,int>
#define X first
#define Y second
using namespace std;
const int N = (int)1e5 + 7 ;
const ll MOD = (ll)998244353;
const ll INF = (ll)1e18 + 7;
const int inf = (int)1e9 + 7;
pii dx[] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
void solve() {
int n,m,r,k,p;
cin>>n>>m>>r>>k>>p;
int a[n+1][m+1];
for(int i=1; i<=n; ++i) {
for(int j=1; j<=m; ++j) {
cin>>a[i][j];
}
}
cout<<"1\n";
return;
while(k--) {
char tp;
int x,y;
cin>>tp>>x>>y;
int cnt = 1;
if(tp=='N') {
for(int i=1; i<=n; ++i) {
if(a[i][x]==y) {
if(cnt<=p) {
a[i][x]--;
cnt++;
}
}
}
}
if(tp=='W') {
for(int i=1; i<=m; ++i) {
if(a[x][i]==y) {
if(cnt<=p) {
a[x][i]--;
cnt++;
}
}
}
}
if(tp=='S') {
for(int i=n; i>=1; --i) {
if(a[i][x]==y) {
if(cnt<=p) {
a[i][x]--;
cnt++;
}
}
}
}
if(tp=='E') {
for(int i=m; i>=1; --i) {
if(a[x][i]==y) {
if(cnt<=p) {
a[x][i]--;
cnt++;
}
}
}
}
}
int mx = 0;
for(int i=1; i<=n-p+1; ++i) {
for(int j=1; j<=m-p+1; ++j) {
int x = i, y = j, sum=0;
for(int ii = x; ii<=x+p-1; ++ii) {
for(int jj = y; jj<=y+p-1; ++jj) {
sum+=a[ii][jj];
}
}
mx = max(mx, sum);
}
}
cout<<mx<<nl;
}
int main() {
IOS
srand(time(0));
//freopen("cinema.in", "r", stdin);
//freopen("cinema.out", "w", stdout);
int tt=1;
//cin>>tt;
while(tt--) {
solve();
}
IOI
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
268 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
5 |
Incorrect |
5 ms |
492 KB |
Output isn't correct |
6 |
Incorrect |
46 ms |
2284 KB |
Output isn't correct |
7 |
Incorrect |
106 ms |
4204 KB |
Output isn't correct |
8 |
Incorrect |
64 ms |
4204 KB |
Output isn't correct |
9 |
Incorrect |
64 ms |
4204 KB |
Output isn't correct |
10 |
Incorrect |
65 ms |
4332 KB |
Output isn't correct |
11 |
Incorrect |
62 ms |
4076 KB |
Output isn't correct |
12 |
Incorrect |
78 ms |
4204 KB |
Output isn't correct |
13 |
Incorrect |
76 ms |
4588 KB |
Output isn't correct |
14 |
Incorrect |
71 ms |
4128 KB |
Output isn't correct |
15 |
Incorrect |
76 ms |
4244 KB |
Output isn't correct |
16 |
Incorrect |
65 ms |
4076 KB |
Output isn't correct |
17 |
Incorrect |
96 ms |
4680 KB |
Output isn't correct |
18 |
Incorrect |
56 ms |
4028 KB |
Output isn't correct |
19 |
Incorrect |
65 ms |
4204 KB |
Output isn't correct |
20 |
Incorrect |
85 ms |
4204 KB |
Output isn't correct |