제출 #578222

#제출 시각아이디문제언어결과실행 시간메모리
578222kingfran1907Stranded Far From Home (BOI22_island)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int maxn = 2010; int n, m; int niz[maxn]; vector< int > graph[maxn]; bool bio[maxn]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", niz+i); for (int i = 0; i < m; i++) { int a, b; scanf("%d%d", &a, &b); graph[a].push_back(b); graph[b].push_back(a); } for (int i = 1; i <= n; i++) { llint sum = niz[i]; set< pair<int, int> > s; memset(bio, false, sizeof bio); bio[i] = true; for (int tren : graph[i]) { s.insert({niz[tren], tren}); } while (!s.empty()) { int x = s.begin()->second; int val = s.begin()->first; if (val > sum) break; s.erase(s.begin()); if (bio[x]) continue; bio[x] = true; sum += val; for (int tren : graph[x]) if (!bio[tren]) s.insert({niz[tren], tren}); } printf("%d", s.empty()); } return 0; }

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

island.cpp: In function 'int main()':
island.cpp:24:3: error: 'llint' was not declared in this scope; did you mean 'lrint'?
   24 |   llint sum = niz[i];
      |   ^~~~~
      |   lrint
island.cpp:36:14: error: 'sum' was not declared in this scope
   36 |    if (val > sum) break;
      |              ^~~
island.cpp:41:4: error: 'sum' was not declared in this scope
   41 |    sum += val;
      |    ^~~
island.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  scanf("%d%d", &n, &m);
      |  ~~~~~^~~~~~~~~~~~~~~~
island.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   scanf("%d", niz+i);
      |   ~~~~~^~~~~~~~~~~~~
island.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   scanf("%d%d", &a, &b);
      |   ~~~~~^~~~~~~~~~~~~~~~