# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
86252 | 2018-11-25T15:18:53 Z | tjdgus4384 | 조개 줍기 (KOI17_shell) | C++14 | 2000 ms | 23152 KB |
#include<cstdio> #include<algorithm> using namespace std; int board[1501][1501], boardsum[1501][1501]; char x; int n; void sum() { int ans = 0; for(int i = 1;i <= n;i++) { for(int j = 1;j <= n;j++) { boardsum[i][j] = board[i][j] + max(boardsum[i - 1][j], boardsum[i][j - 1]); ans += boardsum[i][j]; } } printf("%d\n", ans); } int main() { int a, b; scanf("%d", &n); for(int i = 1;i <= n;i++) { for(int j = 1;j <= n;j++) { scanf("%d", &board[i][j]); } } sum(); for(int i = 0;i < n;i++) { scanf(" %c", &x); scanf("%d %d", &a, &b); if(x == 'U') board[a][b]++; else board[a][b]--; sum(); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 1144 KB | Output is correct |
2 | Correct | 8 ms | 1308 KB | Output is correct |
3 | Correct | 7 ms | 1516 KB | Output is correct |
4 | Correct | 8 ms | 1688 KB | Output is correct |
5 | Correct | 7 ms | 1688 KB | Output is correct |
6 | Correct | 8 ms | 1688 KB | Output is correct |
7 | Correct | 7 ms | 1688 KB | Output is correct |
8 | Correct | 7 ms | 1688 KB | Output is correct |
9 | Correct | 7 ms | 1796 KB | Output is correct |
10 | Correct | 7 ms | 1880 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2032 ms | 23152 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 1144 KB | Output is correct |
2 | Correct | 8 ms | 1308 KB | Output is correct |
3 | Correct | 7 ms | 1516 KB | Output is correct |
4 | Correct | 8 ms | 1688 KB | Output is correct |
5 | Correct | 7 ms | 1688 KB | Output is correct |
6 | Correct | 8 ms | 1688 KB | Output is correct |
7 | Correct | 7 ms | 1688 KB | Output is correct |
8 | Correct | 7 ms | 1688 KB | Output is correct |
9 | Correct | 7 ms | 1796 KB | Output is correct |
10 | Execution timed out | 2032 ms | 23152 KB | Time limit exceeded |
11 | Halted | 0 ms | 0 KB | - |