Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- using namespace std;
- #define print(var) cout << #var << ": " << var << endl;
- int main() {
- unsigned int tests;
- cin >> tests;
- for (unsigned int test = 0; test < tests; test++) {
- int readRows, citiesCount, K;
- cin >> citiesCount >> readRows;
- citiesCount;
- print(citiesCount);
- print(readRows)
- vector<vector<int>> cities;
- for (int city = 0; city < citiesCount; city++) {
- vector<int> v = {};
- cities.push_back(v);
- }
- for (int rows = 0; rows < readRows; rows++) {
- int start, end;
- cin >> start >> end;
- print(start);
- print(end);
- cities[start - 1].push_back(end-1);
- cities[end - 1].push_back(start - 1);
- }
- cin >> K;
- for (int city = 0; city < citiesCount; city++) {
- cout << city+1 << " => " << cities[city].size() << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment