Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:请问我这个哪里错了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator