Submission #783340

# Submission time Handle Problem Language Result Execution time Memory
783340 2023-07-14T21:10:48 Z vh50 Newspapers (CEOI21_newspapers) C++17
0 / 100
0 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" << 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 0 ms 340 KB Token "YES21" doesn't correspond to pattern "YES|NO"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Token "YES21" doesn't correspond to pattern "YES|NO"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Token "YES21" doesn't correspond to pattern "YES|NO"
2 Halted 0 ms 0 KB -