记录编号 122809 评测结果 AAAAAAAAAA
题目名称 [咲 -Saki-] 天才麻将少女什么编 最终得分 100
用户昵称 GravatarHouJikan 是否通过 通过
代码语言 C++ 运行时间 0.339 s
提交时间 2014-09-24 16:28:15 内存使用 0.32 MiB
显示代码纯文本
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <set>
#include <list>
#include <iterator>
#include <ctime>
#include <queue>
#include <stack>
#include <vector>
#include <functional>
#include <deque>
#define For(i,j,k) for(int i=(j);i<=(k);i++)
using namespace std;
typedef long long LL;
typedef unsigned int Uint;
const int INF=0x7fffffff;
const double eps=1e-6;
using namespace std;
//================struct declaration======================

//================var declaration=-========================
const int MAXN=5100;
map <string,int> times;
map <string,string> gakou; 
set <string> mahou;
int n,k,maxt=0;
string Anime;
//===========function declaration====================

//================main code===============================
int main()
{
  string ProgrammeName="sakinani";
  string FloderName="COGS";
  freopen((ProgrammeName+".in").c_str(),"r",stdin);
  freopen((ProgrammeName+".out").c_str(),"w",stdout);
#ifdef DEBUG
  clock_t Start_Time=clock();
  system(("copy C:\\Users\\abc\\Desktop\\HouJikan\\"+FloderName+"\\standard.cpp C:\\Users\\abc\\Desktop\\HouJikan\\"+FloderName+"\\submit.txt").c_str());
#endif  
   cin>>n;
   For(i,1,n)
   {
     string namae,Gakou;
     cin>>namae>>Gakou;
     gakou[namae]=Gakou;
   }
   cin>>k;
   For(i,1,k)
   {
     string namae;
     cin>>namae;
     mahou.insert(namae);
   }
   string namae;
   while (cin>>namae)
   {
     cin>>namae;
     times[gakou[namae]]++;
     if (mahou.count(namae))
       times[gakou[namae]]++;
   }
   map <string,int>::iterator it=times.begin();
   for(;it!=times.end();++it)
     if (it->first!=""&&it->second>maxt)
       maxt=it->second,Anime=it->first;
   cout<<Anime<<endl;
#ifdef DEBUG
  clock_t End_Time=clock();
  printf("\n\nTime Used :%.6lf Ms\n",double(Start_Time-End_Time)/(-CLOCKS_PER_SEC));
#endif
  return 0;
}
//================function code===========================