ural 2073. Log Files
2073. Log Files
Time limit: 1.0 second
Memory limit: 64 MB
Memory limit: 64 MB
Nikolay has decided to become the best programmer in the world! Now he regularly takes part in various programming contests, attentively listens to problems analysis and upsolves problems. But the point is that he had participated in such a number of contests that got totally confused, which problems had already been solved and which had not. So Nikolay conceived to make a program that could read contests’ logs and build beautiful summary table of the problems. Nikolay is busy participating in a new contest so he has entrusted this task to you!
Input
The first line contains an integer n (1 ≤ n ≤ 100). It‘s the number of contests‘ descriptions. Then descriptions are given. The first line of description consists of from 1 to 30 symbols — Latin letters, digits and spaces — and gives the name of contest. It‘s given that the name doesn‘t begin and doesn’t end with a space. In the second line of description the date of contest in DD.MM.YY format is given. It‘s also given that the date is correct and YY can be from 00 to 99 that means date from 2000 till 2099. In the third line of description there are numbers p and sseparated by space (1 ≤ p ≤ 13, 0 ≤ s ≤ 100). It‘s amount of problems and Nikolay’s submits in the contest. Then s lines are given. These are submits’ descriptions. Description of each submit consists of the problem‘s letter and the judge verdict separated by space. The letter of the problem is the title Latin letter and all problems are numbered by first p letters of English alphabet. The judge verdict can be one of the following: Accepted, Wrong Answer, Runtime Error, Time Limit Exceeded, Memory Limit Exceeded, Compilation Error.
Output
Print the table, which consists of n+1 lines and 3 columns. Each line (except the first) gives the description of the contest. The first column gives the name of the contest, the second column gives the date of the contest (exactly as it was given in the input), the third column gives the description of the problems. Every description of problems is the line of 13 characters, where thei-th character correlate with the i-th problem. If the problem got verdict Accepted at least one time, this character is ’o’. If the problem was submitted at least once but wasn’t accepted, the character is ’x’. If the problem was just given at the contest but wasn’t submitted, the character is ’.’. Otherwise, the character is ’ ’ (space). Contests in the table must be placed in the same order as in input.
Column with the name of the contest consists of 30 symbols (shorter names must be extended by spaces added to the right to make this length). Columns with the date and description of problems consist of 8 and 13 characters accordingly.
The first line of the table gives the names of columns. The boundaries of the table are formatted by ’|’, ’-’ и ’+’ symbols. To get detailed understanding of the output format you can look at the example.
Sample
input | output |
---|---|
2 Codeforces Gamma Round 512 29.02.16 5 4 A Accepted B Accepted C Accepted E Accepted URKOP 17.10.15 12 11 A Accepted B Wrong Answer B Time Limit Exceeded J Accepted B Accepted J Time Limit Exceeded J Accepted F Accepted E Runtime Error H Accepted E Runtime Error |
+------------------------------+--------+-------------+ |Contest name |Date |ABCDEFGHIJKLM| +------------------------------+--------+-------------+ |Codeforces Gamma Round 512 |29.02.16|ooo.o | +------------------------------+--------+-------------+ |URKOP |17.10.15|oo..xo.o.o.. | +------------------------------+--------+-------------+ |
Problem Author: Kirill Borozdin (prepared by Kirill Borozdin, Alexey Danilyuk)
Problem Source: Ural Regional School Programming Contest 2015
Problem Source: Ural Regional School Programming Contest 2015
Tags: none
Difficulty: 158
大模拟
1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cmath> 5 #include <deque> 6 #include <vector> 7 #include <queue> 8 #include <iostream> 9 #include <algorithm> 10 #include <map> 11 #include <set> 12 #include <ctime> 13 #include <iomanip> 14 using namespace std; 15 16 const int M = 50; 17 char state[M]; 18 19 inline void solve() 20 { 21 char str[M]; 22 for(int i = 0; i < M; i++) str[i] = ' '; 23 24 gets(str); 25 for(int i = strlen(str); i < M; i++) str[i] = ' '; 26 printf("|"); 27 for(int i = 0; i < 30; i++) printf("%c", str[i]); 28 29 gets(str); 30 for(int i = strlen(str); i < M; i++) str[i] = ' '; 31 printf("|"); 32 for(int i = 0; i < 8; i++) printf("%c", str[i]); 33 34 int n, m; 35 scanf("%d%d", &n, &m); 36 getchar(); 37 for(int i = 0; i < M; i++) state[i] = ' '; 38 for(int i = 0; i < n; i++) state[i] = '.'; 39 while(m--) 40 { 41 char pro = getchar(); 42 getchar(); 43 gets(str); 44 int x = pro - 'A'; 45 if(str[0] == 'A') state[x] = 'o'; 46 else if(state[x] != 'o') state[x] = 'x'; 47 } 48 printf("|"); 49 for(int i = 0; i < 13; i++) printf("%c", state[i]); 50 51 printf("|\n"); 52 } 53 54 int main() 55 { 56 puts("+------------------------------+--------+-------------+"); 57 puts("|Contest name |Date |ABCDEFGHIJKLM|"); 58 59 int t; 60 scanf("%d", &t); 61 getchar(); 62 while(t--) 63 { 64 puts("+------------------------------+--------+-------------+"); 65 solve(); 66 } 67 puts("+------------------------------+--------+-------------+"); 68 return 0; 69 }