제출 #705610

#제출 시각아이디문제언어결과실행 시간메모리
705610Username4132Kutije (COCI21_kutije)C++14
70 / 70
229 ms13920 KiB
#include<iostream> #include<vector> using namespace std; #define forn(i, n) for(int i=0; i<(int)n; ++i) #define PB push_back const int MAXN=1010; int n, m, q, com[MAXN], stat; vector<int> g[MAXN]; void dfs(int v){ com[v]=stat; for(auto to:g[v]) if(!com[to]) dfs(to); } int main(){ scanf("%d %d %d", &n, &m, &q); forn(f, m) forn(i, n){ int a; scanf("%d", &a); g[a-1].PB(i); } forn(i, n) if(!com[i]) ++stat, dfs(i); forn(i, q){ int a, b; scanf("%d %d", &a, &b); printf("%s", com[a-1]==com[b-1]? "DA\n" : "NE\n"); } }

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

Main.cpp: In function 'int main()':
Main.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |     scanf("%d %d %d", &n, &m, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:19:21: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |         int a; scanf("%d", &a);
      |                ~~~~~^~~~~~~~~~
Main.cpp:24:24: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         int a, b; scanf("%d %d", &a, &b);
      |                   ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...