# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
129680 |
2019-07-13T02:12:37 Z |
jhnah917 |
None (KOI17_shell) |
C++14 |
|
2000 ms |
40384 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
ll arr[1515][1515];
ll dp[1515][1515];
ll get(){
ll ret = 0;
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
dp[i][j] = max(dp[i-1][j], dp[i][j-1]) + arr[i][j];
ret += dp[i][j];
}
}
return ret;
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
cin >> arr[i][j];
}
}
cout << get() << "\n";
for(int i=1; i<=n; i++){
char op; int a, b;
cin >> op >> a >> b;
if(op == 'U') arr[a][b]++;
else arr[a][b]--;
cout << get() << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
1272 KB |
Output is correct |
2 |
Correct |
7 ms |
1400 KB |
Output is correct |
3 |
Correct |
7 ms |
1272 KB |
Output is correct |
4 |
Correct |
7 ms |
1272 KB |
Output is correct |
5 |
Correct |
8 ms |
1404 KB |
Output is correct |
6 |
Correct |
8 ms |
1400 KB |
Output is correct |
7 |
Correct |
7 ms |
1372 KB |
Output is correct |
8 |
Correct |
7 ms |
1400 KB |
Output is correct |
9 |
Correct |
7 ms |
1400 KB |
Output is correct |
10 |
Correct |
7 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2059 ms |
40384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
1272 KB |
Output is correct |
2 |
Correct |
7 ms |
1400 KB |
Output is correct |
3 |
Correct |
7 ms |
1272 KB |
Output is correct |
4 |
Correct |
7 ms |
1272 KB |
Output is correct |
5 |
Correct |
8 ms |
1404 KB |
Output is correct |
6 |
Correct |
8 ms |
1400 KB |
Output is correct |
7 |
Correct |
7 ms |
1372 KB |
Output is correct |
8 |
Correct |
7 ms |
1400 KB |
Output is correct |
9 |
Correct |
7 ms |
1400 KB |
Output is correct |
10 |
Execution timed out |
2059 ms |
40384 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |