12667 - Last Blood

All about problems in Volume 126. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

12667 - Last Blood

Post by uDebug »

Here's some input / output that I found useful during testing / debugging.

Please note that there are 2 separate input / output test cases.

Input 1:

Code: Select all

5 10 18
0 2 B No
11 2 B Yes
20 3 D Yes
35 8 E No
40 8 E No
45 7 E No
50 10 D Yes
100 4 D No
120 6 B Yes
160 2 E Yes
180 2 D Yes
210 3 B Yes
240 10 G Yes
250 10 G Yes
270 2 B Yes
295 8 E Yes
296 7 L Yes
299 10 D Yes
AC Output 1:

Code: Select all

A - -
B 210 3
C - -
D 180 2
E 295 8
Input 2:
[Removed because it didn't follow the input specifications.]
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.
fazel
New poster
Posts: 6
Joined: Fri Aug 02, 2013 4:44 am

Re: 12667 - Last Blood

Post by fazel »

thanks friend for your contributions to community, it was really useful for me( for (12662 Good teacher))

can any one help me with this i have no idea were is the problem .

Code: Select all

//io
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <iomanip>
//useful C
#include <cctype>
#include <ctime>
#include <math.h>
//string
#include <sstream>
#include <string>
#include <string.h>
//container
#include <set>
#include <map>
#include <list>
#include <vector>
#include <queue>
#include <stack>
#include <bitset>
//algorithm STL
#include <functional>
#include <numeric>
#include <algorithm>


using namespace std;
//int mov[4][2]= {{-1,0},{1,0},{0, -1} , {0, 1}};
//int mov[8][2]= { {-1,0},{1,0},{0, -1} , {0, 1} , {-1,-1} , {-1, 1} , {1 ,-1} , {1, 1}};
typedef  long long ll;
typedef unsigned long long ull;
typedef unsigned int ul;
typedef vector<int> vi;
#define SETALL(a , val) memset( a , val , sizeof a)
#define INF 1000000000 

//Data Structures!!
typedef pair<int ,int > pi;
int main()
{
	//freopen("in.txt" , "r" , stdin);
	//freopen("out.txt" , "w" , stdout);
	bool first[13][110];
	pi stat[13];
	int n , t ,m ;
	memset( first , true , sizeof first);
	memset( stat  , -1 , sizeof stat);

	cin>>n>>t>>m;

	for(int i = 0 ;  i < m ; i++)
	{
		int ti , tt;
		string ver;
		char pp;
		
		cin>>ti >>tt>>pp>>ver;

		if(ver == "Yes")
			if(first[pp - 'A'][tt])
			{
				first[pp - 'A'][tt] = false;	
				stat[pp - 'A'] = make_pair(ti , tt);
			}
	}
	
	for(int i = 0 ; i < n ;i++)
		if( stat[i].first >=0 )
			cout<<char('A'+i)<<' '<<stat[i].first<<' '<<stat[i].second<<endl;
		else
			cout<<char('A' + i)<<' ' <<'-'<<' '<<'-' <<endl;

}
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12667 - Last Blood

Post by brianfry713 »

That is AC code.
Check input and AC output for thousands of problems on uDebug!
Post Reply

Return to “Volume 126 (12600-12699)”