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;
}