Submission #4153

# Submission time Handle Problem Language Result Execution time Memory
4153 2013-09-02T14:52:58 Z gudbooy Cactus? Not cactus? (kriii1_C) C++
Compilation error
0 ms 0 KB
#include<iostream>
#include<string.h>
#include<string>
#include<vector>
#include<iterator>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<functional>
#include<cmath>
using namespace std;
#define NM 100000
int nm[NM][2];
int N, M;
vector<pair<int, int>> diff;
bool cacus()
{

	for(size_t i=0; i<diff.size(); i++)
	{
		for(size_t j=i+1; j<diff.size(); j++)
		{
			int index_i = diff[i].second;
			int index_j = diff[j].second;
			if(nm[index_i][0] == nm[index_j][1] || nm[index_i][1] == nm[index_j][0])
				return true;
		}
	}
	return false;
}
void test()
{
	int result=0;
	
	cin >> N >> M;
	for(int i=0; i<M; i++)
	{		
			cin >> nm[i][0] >> nm[i][1];
			if(abs(nm[i][0]-nm[i][1]) > 1)
				diff.push_back(make_pair(nm[i][0]-nm[i][1], i));
	}
	if(cacus())
		cout << "Not cactus" << endl;
	else
		cout << "Cactus" << endl;
}
int main()
{
		test();		
	return 0;
}

Compilation message

C.cpp:17:21: error: '>>' should be '> >' within a nested template argument list
C.cpp: In function 'void test()':
C.cpp:35:6: warning: unused variable 'result' [-Wunused-variable]