Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <string>
- #include <math.h>
- #include <vector>
- #include <cmath>
- using namespace std;
- struct compedit
- {
- string name;
- map <char, set <string>> result;
- int sc;
- string data;
- };
- void build(compedit compedits)
- {
- cout << "|";
- cout << compedits.name;
- for (int i = 1; i <= 30 - compedits.name.size(); i++)
- cout << " ";
- cout << "|";
- cout << compedits.data;
- cout << "|";
- for (int i = 0; i <= compedits.sc - 1; i++)
- {
- char prom = 65 + i;
- if (compedits.result.find(prom) != compedits.result.end())
- if (compedits.result[prom].find(" Accepted") != compedits.result[prom].end())
- cout << "o";
- else
- cout << "x";
- else
- cout << ".";
- }
- for (int i = 1; i <= 13- compedits.sc; i++)
- cout << " ";
- cout << "|" << endl;
- cout << "+------------------------------+--------+-------------+" << endl;
- }
- void start()
- {
- cout << "+------------------------------+--------+-------------+" << endl;
- cout << "|";
- cout << "Contest name ";
- cout << "|";
- cout << "Date ";
- cout << "|";
- cout << "ABCDEFGHIJKLM";
- cout << "|" << endl;
- cout << "+------------------------------+--------+-------------+" << endl;
- }
- int main()
- {
- int n;
- compedit compedits[101];
- int prom;
- cin >> n;
- getline(cin, compedits[0].name);
- for (int i = 1; i <= n; i++)
- {
- if(prom==0)
- getline(cin, compedits[0].name);
- getline(cin, compedits[i].name);
- getline(cin, compedits[i].data);
- cin >> compedits[i].sc;
- cin >> prom;
- for (int j = 1; j <= prom; j++)
- {
- string res;
- char exc;
- cin >> exc;
- getline(cin, res);
- if (compedits[i].result.find(exc) != compedits[i].result.end())
- compedits[i].result[exc].insert(res);
- else
- {
- set <string> prom2;
- prom2.insert(res);
- compedits[i].result.insert(pair<char, set <string>>(exc,prom2));
- }
- }
- }
- start();
- for (int i = 1; i <= n; i++)
- build(compedits[i]);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment