Submission #699175

#TimeUsernameProblemLanguageResultExecution timeMemory
699175GusterGoose27Island (NOI18_island)C++11
100 / 100
61 ms5440 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 4e5; int deg[MAXN]; int sub[MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; n += m; for (int i = 0; i < n-1; i++) { int x, y; cin >> x >> y; deg[x-1]++; deg[y-1]++; } for (int i = 0; i < n; i++) { sub[deg[i]]++; } int num = n; for (int i = 1; i < n; i++) { num -= sub[i]; if (num) cout << i << " " << num << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...