# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
824609 |
2023-08-14T08:15:44 Z |
exodus_ |
Orchard (NOI14_orchard) |
C++14 |
|
390 ms |
8176 KB |
#include<bits/stdc++.h>
using namespace std;
int orch[155][5005];
int main() {
int r,c;
int hitone=0;
cin >> r >> c;
for(int i=1; i<=r; i++) {
for(int j=1; j<=c; j++) {
cin >> orch[i][j];
if(orch[i][j]==1) hitone++;
}
}
int answer = hitone;
int ter, sum;
for(int i=1; i<=r; i++) {
vector<int>co(c+1,0);
for(int j=i; j<=r; j++) {
sum = 0;
ter = 0;
for(int kol=1; kol<=c; kol++) {
if(orch[j][kol]==0) {
sum++;
} else {
sum--;
}
co[kol]+=sum;
answer = min(answer, hitone+co[kol]-ter);
ter = max(ter, co[kol]);
}
}
}
cout << answer << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
312 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
96 ms |
8176 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
1468 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
712 KB |
Output is correct |
2 |
Correct |
11 ms |
980 KB |
Output is correct |
3 |
Correct |
11 ms |
980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
390 ms |
4712 KB |
Output is correct |
2 |
Correct |
373 ms |
4724 KB |
Output is correct |
3 |
Correct |
374 ms |
4712 KB |
Output is correct |