제출 #419051

#제출 시각아이디문제언어결과실행 시간메모리
419051EncryptingWolfSplit the Attractions (IOI19_split)C++14
0 / 100
1 ms332 KiB
#include <vector>
#include <iostream>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define FOR(i,x,y) for (ll i = x; i <y; i++)

vector<vector<int>> adj;

vector<int> ret;
void dfs(int x)
{
	if (ret[x] == 2)
		return;
	ret[x] = 2;
	for (auto i : adj[x])
		dfs(i);
}

vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q)
{
	ret.resize(n, 3);
	FOR(i, 0, p.size())
	{
		adj[p[i]].push_back(q[i]);
		adj[q[i]].push_back(p[i]);
	}
	dfs(0);
	FOR(i, 0, n)
	{
		if (ret[i] != 2)
		{
			ret[i] = 1;
			return ret;
		}
	}

	return ret;
}

컴파일 시 표준 에러 (stderr) 메시지

split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:7:37: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 | #define FOR(i,x,y) for (ll i = x; i <y; i++)
......
   24 |  FOR(i, 0, p.size())
      |      ~~~~~~~~~~~~~~                  
split.cpp:24:2: note: in expansion of macro 'FOR'
   24 |  FOR(i, 0, p.size())
      |  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...