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

20584K 94ms

Posted by KatrineYang at 2016-07-12 09:36:44 on Problem 3263
//============================================================================
// 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:
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