제출 #599264

#제출 시각아이디문제언어결과실행 시간메모리
599264jmyszka2007Furniture (JOI20_furniture)C++17
5 / 100
912 ms756 KiB
#include <bits/stdc++.h> using namespace std; int vis[110][110]; int meb[110][110]; int n, m; void dfs(int x, int y) { if(x > n || y > m || vis[x][y]) { return; } vis[x][y] = 1; dfs(x + 1, y); dfs(x, y + 1); } int main() { scanf("%d%d", &n, &m); for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { scanf("%d", &meb[i][j]); } } int t; scanf("%d", &t); while(t--) { for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { vis[i][j] = meb[i][j]; } } int a, b; scanf("%d%d", &a, &b); vis[a][b] = 1; dfs(1, 1); if(vis[n][m]) { printf("%d\n", 1); meb[a][b] = 1; } else { printf("%d\n", 0); } } }

컴파일 시 표준 에러 (stderr) 메시지

furniture.cpp: In function 'int main()':
furniture.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |  scanf("%d%d", &n, &m);
      |  ~~~~~^~~~~~~~~~~~~~~~
furniture.cpp:18:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |    scanf("%d", &meb[i][j]);
      |    ~~~~~^~~~~~~~~~~~~~~~~~
furniture.cpp:22:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |  scanf("%d", &t);
      |  ~~~~~^~~~~~~~~~
furniture.cpp:30:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |   scanf("%d%d", &a, &b);
      |   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...