#include using namespace std; typedef unsigned int uint; typedef long long int ll; typedef unsigned long long int ull; #define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout< ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<>=1,k++)s=(s<<1)|(u&1);for(;0>=1)cout<<(s&1);}} #define TIME chrono::system_clock::now() #define MILLISEC(t) (chrono::duration_cast(t).count()) template ostream& operator <<(ostream &o,const pair p){o<<"("< score[5000]; map namemap; string namemap_rev[5000]; int calc_score(int quizid){ double rank = solved[quizid]+1; double s = 50*level[quizid] + 50.0/(0.8+0.2*rank)*level[quizid]; return s; } int main(){ int i,j,k,l; cin >> n; for (i=0;i> nquery; string name; for (i=nquery;0> name; int id = 0; if (!namemap.count(name)){ id = nscore++; namemap[name]=id; namemap_rev[id]=name; score[id].resize(3+n); score[id][2+n] = id; }else{ id = namemap[name]; } cin >> name; k = name[0]-'A'; score[id][0]-=(calc_score(k)); score[id][1] = (-i); score[id][2+k]+=(calc_score(k)); solved[k]++; } sort(score,score+nscore); for (i=0;i