ural 2073(一些c++的应用)
来源:互联网 发布:讲文明知礼仪内容 编辑:程序博客网 时间:2024/06/05 20:07
ikolay 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.
Example
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.. |
+——————————+——–+————-+
一遍过。。。昨晚应该自己撸的
#include <bits/stdc++.h>using namespace std;int vis[20];int vis2[20];char date[30];int main(){ int t; cin>>t; string contest; string jieguo; int qnum,sub; char qtitle; printf("+------------------------------+--------+-------------+\n"); printf("|Contest name |Date |ABCDEFGHIJKLM|\n");; printf("+------------------------------+--------+-------------+\n"); getchar(); while(t--) { memset(vis,0,sizeof(vis)); memset(vis2,0,sizeof(vis2)); getline(cin,contest); scanf(" %s",date); cin>>qnum>>sub; getchar(); for(int i=1;i<=sub;i++) { scanf(" %c",&qtitle); getchar(); getline(cin,jieguo,'\n'); if(jieguo=="Accepted") vis[qtitle-'A']=1; else vis2[qtitle-'A']=1; } printf("|");cout<<contest; int len=contest.length(); int v=0; if(len<30) v=30-len; for(int i=0;i<v;i++) printf(" "); printf("|"); cout<<date; int len1=strlen(date); v=0; if(len1<8) v=8-len1; for(int i=0;i<v;i++) printf(" "); printf("|"); for(int i=0;i<qnum;i++) { if(vis[i]==1) printf("o"); else if(vis2[i]==1) printf("x"); else printf("."); } for(int i=qnum;i<13;i++) printf(" "); printf("|\n"); printf("+------------------------------+--------+-------------+\n"); }}
- ural 2073(一些c++的应用)
- C语言的一些高阶应用(只是代码)
- ural 1654【栈应用】
- hal-c 在dsp 上应用的一些想法
- C和C++中一些特殊宏的应用
- Objective-C中NSString与NSMutableString的一些简单应用
- linux命令与c语言的一些小应用
- c中宏定义的一些应用积累
- Ural 1354. Palindrome. Again Palindrome KMP的应用
- URAL 1776 C
- Ural 1613 For Fans of Statistics(vector应用)
- 一些容易被大家忽视的C语言函数和一些C++函数的基本应用
- ural 1685. Orthography (树的遍历)
- 针对一些在android 应用界面使用Ctrl + C组合键,直接退出应用的解决方案
- Datagrid的一些应用(一)
- DATAGRID的一些应用(二)
- DATAGRID的一些应用(三)
- SYMFOWARE的一些应用心得(1)
- 用贝塞尔曲线自己写的一个电量显示的控件
- webapp不小心删除解决办法
- 论文笔记: Deep Residual Learning for Image Recognition
- linux下mysql开启远程访问权限 防火墙开放3306端口
- oracle获取字符串长度函数length()和hengthb()
- ural 2073(一些c++的应用)
- 如何保持高效率 -坚持好习惯
- mac 设置为允许来自任何来源都可以
- docker Images/run -d/logs/ps/stop/search/pull 命令
- Redis初探一
- Ternsorflow启动图的三个方法对比
- 数据库MYSQL
- 用java简单的实现单链表的基本操作
- 对话高考网(3)