제출 #74895

#제출 시각아이디문제언어결과실행 시간메모리
74895VardanyanBosses (BOI16_bosses)C++14
0 / 100
2 ms544 KiB
//#pragma GCC optimize "-O3" #include <bits/stdc++.h> using namespace std; const int N = 5001; bool c[N]; int n; int ans = 1000*1000*1000+7; int g[N][N]; int f[N][N]; int main(){ scanf("%d",&n); for(int i = 1;i<=n;i++) for(int j = 1;j<=n;j++) f[i][j] = ans; for(int i = 1;i<=n;i++){ f[i][i] = 0; int ki; scanf("%d",&ki); for(int j = 1;j<=ki;j++){ int x; scanf("%d",&x); f[x][i] = 1; } } for(int i = 1;i<=n;i++){ for(int j = 1;j<=n;j++){ for(int k = 1;k<=n;k++){ f[j][k] = min(f[j][k],f[j][i]+f[i][k]); } } } for(int i = 1;i<=n;i++){ int val = 0; for(int j = 1;j<=n;j++) val+=(f[i][j]+1); ans = min(ans,val); } printf("%d\n",ans); return 0; }

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

bosses.cpp: In function 'int main()':
bosses.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
bosses.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&ki);
         ~~~~~^~~~~~~~~~
bosses.cpp:20:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&x);
             ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...