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 |
20584K 94ms//============================================================================ // Name : main3263.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> using namespace std; bool state[10086][10086] = {0}; int main() { int N, I, H, R; cin >> N >> I >> H >> R; int gs[10086] = {0}; for(int i = 0; i < R; i++){ int s, t; cin >> s >> t; if(state[s][t] || state[t][s]) continue; state[s][t] = true; if(s < t){ for(int j = s+1; j < t; j++) gs[j]++; } else{ for(int j = t+1; j < s; j++) gs[j]++; } } for(int i = 1; i <= N; i++) cout << H-gs[i] << endl; //cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator