Submission #86252

#TimeUsernameProblemLanguageResultExecution timeMemory
86252tjdgus4384조개 줍기 (KOI17_shell)C++14
12 / 100
2032 ms23152 KiB
#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 (stderr)

shell.cpp: In function 'int main()':
shell.cpp:25:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
shell.cpp:30:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &board[i][j]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~
shell.cpp:36:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" %c", &x);
         ~~~~~^~~~~~~~~~~
shell.cpp:37:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &a, &b);
         ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...