# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129680 | jhnah917 | 조개 줍기 (KOI17_shell) | C++14 | 2059 ms | 40384 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>
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";
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |