제출 #864469

#제출 시각아이디문제언어결과실행 시간메모리
864469iskhakkutbilimRailway (BOI17_railway)C++17
0 / 100
42 ms7620 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define all(a) a.begin(), a.end() int n, m, k; vector< pair<int, int> > edge; main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m >> k; for(int i = 1;i < n; i++){ int a, b; cin >> a >> b; edge.push_back({a, b}); } map<int, int> mp; for(int i = 0;i < m; i++){ int sz; cin >> sz; if(sz % 2) assert(false); for(int j = 0;j < sz; j++){ int idx; cin >> idx; mp[idx]++; } } vector<int> ans; for(auto [x, y] : mp){ if(y >= k){ ans.push_back(x); } } sort(all(ans)); cout << ans.size() << '\n'; for(int x : ans) cout << x << ' '; return 0; }

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

railway.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...