제출 #743162

#제출 시각아이디문제언어결과실행 시간메모리
743162Azther0zBitaro’s Party (JOI18_bitaro)C++11
0 / 100
2076 ms2724 KiB
#include <bits/stdc++.h> using namespace std; vector<vector<int>> adjl(100001); bitset<100001> visited,busy; int result; void dfs(int current,int prev,int sum) { if(!busy[current]) result=max(result,sum); for(auto next:adjl[current]) dfs(next,current,sum+1); } int main() { int n,m,q; scanf("%d%d%d",&n,&m,&q); while(m--) { int a,b; scanf("%d%d",&a,&b); adjl[b].push_back(a); } while(q--) { int a,b,c; scanf("%d%d",&a,&b); visited=busy=0; while(b--) { scanf("%d",&c); busy[c]=true; } result=-1; dfs(a,-1,0); printf("%d\n",result); } }

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

bitaro.cpp: In function 'int main()':
bitaro.cpp:16:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |  scanf("%d%d%d",&n,&m,&q);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~
bitaro.cpp:20:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |   scanf("%d%d",&a,&b);
      |   ~~~~~^~~~~~~~~~~~~~
bitaro.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   26 |   scanf("%d%d",&a,&b);
      |   ~~~~~^~~~~~~~~~~~~~
bitaro.cpp:30:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |    scanf("%d",&c);
      |    ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...