Submission #783342

# Submission time Handle Problem Language Result Execution time Memory
783342 2023-07-14T21:11:18 Z vh50 Newspapers (CEOI21_newspapers) C++17
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
const int MAXN = 2e3;
int n, m, marc[MAXN][MAXN];
vector <int> g[MAXN];
void dfs(int a, int r)
{
	marc[a][r] = 1;
	for(auto v : g[a])
	{
		if(marc[v][r])	continue;
		dfs(v, r);
	}
}
main()
{
	cin >> n >> m;
	for(int i = 0; i < m; i++)	
	{
		int a, b;
		cin >> a >> b;
		a--, b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	if(m == n - 1)	cout << "YES" << endl << 2 << "1 1" << endl;
	else cout << "NO" << endl;
}

Compilation message

newspapers.cpp:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   17 | main()
      | ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Integer parameter [name=k] equals to 21, violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Integer parameter [name=k] equals to 21, violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Integer parameter [name=k] equals to 21, violates the range [1, 5]
2 Halted 0 ms 0 KB -