Description

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 s separated 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 the i-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

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.. |
+------------------------------+--------+-------------+

题目意思:根据每一次比赛的结果生成一个总结的表格,刚开始确实没看懂这是什么意思,尤其是vj上的那个破排版,输出的表格是一半一半的,思路很简单,操作有点麻烦吧。

 #include<stdio.h>
#include<string.h>
struct message
{
char id;
char ss[];
};
int main()
{
int t,i,j,m,n,k,flag;
int num[];
char s[],x[];
scanf("%d",&t);
getchar();
for(j=;j<t;j++)
{
gets(s);
gets(x);
struct message a[];
memset(num,,sizeof(num));
flag=;
scanf("%d%d",&n,&m);
getchar();
for(i=; i<m; i++)
{
scanf("%c",&a[i].id);
getchar();
gets(a[i].ss);
if(strcmp(a[i].ss,"Accepted")==)
{
num[a[i].id-'A']=;
}
else if(strcmp(a[i].ss,"Accepted")!=&&num[a[i].id-'A']!=)
{
num[a[i].id-'A']=;
}
else
{
continue;
} }
if(flag==)
{
printf("+------------------------------+--------+-------------+\n");
printf("|Contest name |Date |ABCDEFGHIJKLM|\n");
printf("+------------------------------+--------+-------------+\n");
flag=;
}
printf("|%-30s|%s|",s,x);
for(i=;i<n;i++)
{
if(num[i]==)
{
printf(".");
}
else if(num[i]==)
{
printf("o");
}
else if(num[i]==)
{
printf("x");
}
}
for(k=;k<=-n;k++)
{
printf(" ");
}
printf("|\n");
printf("+------------------------------+--------+-------------+\n");
}
return ;
}

Log Files的更多相关文章

  1. ural 2073. Log Files

    2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...

  2. How to configure Veritas NetBackup (tm) to write Unified and Legacy log files to a different directory

    Problem DOCUMENTATION: How to configure Veritas NetBackup (tm) to write Unified and Legacy log files ...

  3. How to delete expired archive log files using rman?

    he following commands will helpful to delete the expired archive log files using Oracle Recovery Man ...

  4. Common Linux log files name and usage--reference

    reference:http://www.coolcoder.in/2013/12/common-linux-log-files-name-and-usage.html if you spend lo ...

  5. 14.7.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量和大小

    14.7.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量和大小 改变 InnoDB ...

  6. 14.5.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量

    14.5.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量 改变InnoDB redo ...

  7. How to Collect Bne Log Files for GL Integrators

    In this Document   Goal   Solution APPLIES TO: Oracle General Ledger - Version 11.0 and laterInforma ...

  8. EBS R12 LOG files 位置

    - Apache, OC4J and OPMN: $LOG_HOME/ora/10.1.3/Apache$LOG_HOME/ora/10.1.3/j2ee$LOG_HOME/ora/10.1.3/op ...

  9. 手动创建binary log files和手动编辑binary log index file会有什么影响

    基本环境:官方社区版MySQL 5.7.19 一.了解Binary Log结构 1.1.High-Level Binary Log Structure and Contents • Binlog包括b ...

  10. 调整innodb redo log files数目和大小的具体方法和步骤

    相较于Oracle的在线调整redo日志的数目和大小,mysql这点则有所欠缺,即使目前的mysql80版本,也不能对innodb redo日志的数目和大小进行在线调整,下面仅就mysql调整inno ...

随机推荐

  1. Linux 只显示目录或者文件方法

    ls 参数 -a 表示显示所有文件,包含隐藏文件-d 表示显示目录自身的属性,而不是目录中的内容-F 选项会在显示目录条目时,在目录后加一个/ 只显示目录 方法一: find . -type d -m ...

  2. 阿里云Docker镜像仓库(Docker Registry)

    镜像仓库申请地址: https://cr.console.aliyun.com/cn-shanghai/instances/repositories   一.创建命名空间 例如daniel-hub   ...

  3. js实现99乘法表的编写(双层for循环与递归方法)

    双层for循环实现方法: function nine (num) { ; i <= num; i++){ var str = ''; ; k <= num; k++){ if(i > ...

  4. ecshop跨站漏洞详情及修补网站漏洞

    ecshop目前最新版本为4.0,是国内开源的一套商城系统,很多外贸公司,以及电商平台都在使用,正因为使用的人数较多,很多攻击者都在挖掘该网站的漏洞,就在最近ecshop被爆出高危漏洞,该漏洞利用跨站 ...

  5. VS中添加lib与dll

    参考与拓展阅读:https://blog.csdn.net/u012043391/article/details/54972127 lib: 1.附加包含目录---添加工程的头文件目录:       ...

  6. WMI、WQL语言、WQL测试工具wbemtest.exe

    Windows Management Instrumentation (WMI) 是 Windows 操作系统的一个组件,允许通过编程方式访问应用程序.服务和其他计算机组件的管理信息(例如,配置设置和 ...

  7. Android ObjectOutputStream Serializable引发的血案

    遇到一个问题 安装后第二次进app,闪退 重现步骤 [前置条件] 打包分支:dev_7.13 手机:vivo NEX 8.1.0 [步骤] 安装三星app----同意用户协议进入书城---连续点击ba ...

  8. react组件性能

    一.渲染原理 二.性能优化 三.Immutable在性能优化中的作用

  9. VS2015 更改C++模式

    亲爱的小伙伴,有没有发现你们的VS2015装完以后和老江湖们用的不一样了,人家的界面打开是这样的 而你的界面打开是这样的 虽然看是只有一左一右的区别,但是内在确实有好多不一样. 想不想想老江湖一样,拥 ...

  10. python一标准异常总结大全(非常全)

    Python标准异常总结 AssertionError 断言语句(assert)失败 AttributeError 尝试访问未知的对象属性 EOFError 用户输入文件末尾标志EOF(Ctrl+d) ...