89742024-02-09 16:22:21zeytonxHálózati biztonság (50)cpp17Wrong answer 4/50382ms19992 KiB
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define endl "\n"
#define pll pair<ll,ll>
#define vll vector<ll>
#define mll map<ll,ll>
#define fs first
#define sc second

const ll MOD = 1e9+7;

void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	vector<vector<ll>> g(n);
	for(ll i = 0; i < m; i++)
	{
		ll a, b;
		cin >> a >> b;
		a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	set<ll> ans, ans2;
	for(ll i = 0; i < n; i++)
		if(g[i].size() >= k)
			ans.insert(i);
	
	for(ll i : ans)
	{
		ll ok = 0;
		for(ll j = 0; j < g[i].size(); j++)
			if(count(ans.begin(), ans.end(), g[i][j]))
				ok++;
		if(ok >= k)
			ans2.insert(i);
	}

	cout << ans.size() << endl;
	for(ll i : ans)
		cout << i+1 << " ";
	cout << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--)
        solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/03ms2100 KiB
2Wrong answer0/043ms10688 KiB
3Wrong answer0/23ms2360 KiB
4Wrong answer0/23ms2596 KiB
5Accepted2/23ms2804 KiB
6Wrong answer0/23ms2876 KiB
7Wrong answer0/23ms3160 KiB
8Wrong answer0/23ms3020 KiB
9Wrong answer0/23ms3056 KiB
10Accepted2/2173ms3884 KiB
11Wrong answer0/24ms3480 KiB
12Wrong answer0/29ms3908 KiB
13Wrong answer0/33ms3864 KiB
14Wrong answer0/34ms4684 KiB
15Wrong answer0/36ms5280 KiB
16Time limit exceeded0/3382ms7140 KiB
17Wrong answer0/36ms5160 KiB
18Wrong answer0/313ms7292 KiB
19Wrong answer0/345ms15956 KiB
20Wrong answer0/375ms19992 KiB
21Wrong answer0/368ms16328 KiB
22Wrong answer0/33ms4440 KiB