結果
| 問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
| コンテスト | |
| ユーザー |
sugarrr
|
| 提出日時 | 2018-07-23 00:20:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,960 bytes |
| コンパイル時間 | 2,985 ms |
| コンパイル使用メモリ | 102,300 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 05:27:53 |
| 合計ジャッジ時間 | 2,920 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 25 |
ソースコード
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>
using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005
ll mod(ll a){
ll c=a%i_7;
if(c>=0)return c;
else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=1000000000000;/*10^12*/
#define rep(i,l,r) for(ll i=l;i<=r;i++)
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
//////////////////////////////////////
#define N 30
struct person{
string name;
int score[N];
int sumscore=0;
ll lastsubmit=0;
};
bool comp(person a,person b){
if(a.sumscore==b.sumscore&&a.lastsubmit<b.lastsubmit){
return true;
}else if(a.sumscore>b.sumscore){
return true;
}else return false;
}
int ansnum[N];
int main(){
int n;cin>>n;
int l[n];rep(i,0,n-1)cin>>l[i];
int t;cin>>t;
vector<person> p;
rep(i,0,t-1){
string name;cin>>name;
string prob;cin>>prob;
int q;q=prob[0]-'A';
ansnum[q]++;
ll size=p.size();
int pos=0;
while(pos<=size-1){
if(p[pos].name!=name){
pos++;
}else{
break;
}
}
if(pos==size){
person newp;
newp.name=name;
rep(i,0,n-1)newp.score[i]=0;
p.push_back(newp);
}
p[pos].lastsubmit=i;
p[pos].score[q]=50*l[q]+(int)((double)(50*l[q])/(double)(0.8+0.2*(double)ansnum[q]));
p[pos].sumscore+=p[pos].score[q];
}
sort(p.begin(),p.end(),comp);
ll size=p.size();
rep(i,0,size-1){
cout<<i+1<<" "<<p[i].name<<" ";
rep(j,0,n-1)cout<<p[i].score[j]<<" ";
cout<<p[i].sumscore<<endl;
}
return 0;
}
sugarrr