# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
57475 | 2018-07-15T06:38:00 Z | eric4266 | 조개 줍기 (KOI17_shell) | C++14 | 2000 ms | 23124 KB |
#include <stdio.h> #define max(a,b) ((a)>(b)?(a):(b)) int A[1501][1501]; int DP[1501][1501]; int n,sum1; int sum() { sum1=0; int i,j; for(i=1; i<=n; i++) { for(j=1; j<=n; j++) { sum1+=DP[i][j]; } } return sum1; } int main() { int i,j,k,a,x,y; char pm; scanf("%d",&n); for(i=1; i<=n; i++) { for(j=1; j<=n; j++) { scanf("%d",&A[i][j]); } } for(i=1; i<=n; i++) { for(j=1; j<=n; j++) { DP[i][j]=max(DP[i-1][j],DP[i][j-1])+A[i][j]; } } printf("%d\n",sum()); for(i=1; i<=n; i++) { scanf(" %c%d%d",&pm,&x,&y); if(pm=='U') { A[x][y]++; } else A[x][y]--; for(k=x; k<=n; k++) { for(j=y; j<=n; j++) { DP[k][j]=max(DP[k-1][j],DP[k][j-1])+A[k][j]; } } printf("%d\n",sum()); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 1148 KB | Output is correct |
2 | Correct | 8 ms | 1316 KB | Output is correct |
3 | Correct | 9 ms | 1456 KB | Output is correct |
4 | Correct | 11 ms | 1736 KB | Output is correct |
5 | Correct | 11 ms | 1760 KB | Output is correct |
6 | Correct | 10 ms | 1760 KB | Output is correct |
7 | Correct | 11 ms | 1772 KB | Output is correct |
8 | Correct | 9 ms | 1796 KB | Output is correct |
9 | Correct | 9 ms | 1820 KB | Output is correct |
10 | Correct | 7 ms | 1844 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2087 ms | 23124 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 1148 KB | Output is correct |
2 | Correct | 8 ms | 1316 KB | Output is correct |
3 | Correct | 9 ms | 1456 KB | Output is correct |
4 | Correct | 11 ms | 1736 KB | Output is correct |
5 | Correct | 11 ms | 1760 KB | Output is correct |
6 | Correct | 10 ms | 1760 KB | Output is correct |
7 | Correct | 11 ms | 1772 KB | Output is correct |
8 | Correct | 9 ms | 1796 KB | Output is correct |
9 | Correct | 9 ms | 1820 KB | Output is correct |
10 | Execution timed out | 2087 ms | 23124 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |