- 輸入
- 如果WA->回到1.
- 如果已經AC->回到1.
- 更新problem[]資料
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
沒有留言:
張貼留言