Cod sursa(job #2889259)
| Utilizator | Data | 12 aprilie 2022 15:27:26 | |
|---|---|---|---|
| Problema | Plantatie | Scor | 50 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream f("plantatie.in");
ofstream g("plantatie.out");
int a[501][501];
int n, m, l, c, k;
int main()
{
f >> n >> m;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
f >> a[i][j];
for(; m; m--) {
f >> l >> c >> k;
int maxim = 0;
for(int i = l; i < l + k; i++)
for(int j = c; j < c + k; j++)
maxim = max(maxim, a[i][j]);
g << maxim << '\n';
}
return 0;
}
