Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:请问我这个哪里错了

Posted by 2016gdgzoi467 at 2017-05-28 11:58:13 on Problem 2665
In Reply To:请问我这个哪里错了 Posted by:zdy123 at 2017-05-26 20:52:35
> #include<iostream>
> using namespace std;
> int main()
> {
> 	unsigned long int i, road, num, n, m;
> 		bool tree[2000000001];//必须开全局,调用栈炸了
> 
> 	for (i = 0; i <= 2000000001; i++)
> 		tree[i] = true;
> 	cin >> road >> num;
> 	while (num--)
> 	{
> 		cin >> n >> m;
> 		for (i = n; i <= m; i++)
> 			tree[i] = false;
> 	}
> 	int count = 0;
> 	for (i = 0; i <= road; i++)
> 		if (tree[i]) count++;
> 	cout << count << endl;
> 	return 0;
> }
//这道题要用线段树

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator