Skip to content

Instantly share code, notes, and snippets.

@KT-Yeh
Created February 13, 2014 07:19
#include <iostream>
#include <string>
//#include <cstdio>
using namespace std;
struct team_type{
bool problem_AC[13] = {0};
}team[101];
struct problem_type{
int time;
int team_ID = 0;
}problem[15];
int main()
{
ios::sync_with_stdio(false);
// freopen ("input.txt","rt",stdin);
int n, t, m;
cin >> n >> t >> m;
int time, ID;
string problem_name, state;
for (int i = 0; i < m; i++){
cin >> time >> ID >> problem_name >> state;
if (state != "Yes") continue;
int index = problem_name[0]-'A';
if (team[ID].problem_AC[index] == false){
team[ID].problem_AC[index] = true;
problem[index].time = time;
problem[index].team_ID = ID;
}
}
for (int i = 0; i < n; i++){
if (problem[i].team_ID != 0)
cout << char(i+'A') << ' ' << problem[i].time << ' '
<< problem[i].team_ID << endl;
else
cout << char(i+'A') << " - -" << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment