Submission #783336

# Submission time Handle Problem Language Result Execution time Memory
783336 2023-07-14T21:07:28 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;
	if(m == n - 1)	{cout << "YES" << endl; return 0;}
	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);
	}
	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 Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -