結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー sugarrrsugarrr
提出日時 2018-07-23 00:18:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,920 bytes
コンパイル時間 1,251 ms
コンパイル使用メモリ 113,396 KB
実行使用メモリ 5,272 KB
最終ジャッジ日時 2023-08-27 01:05:23
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    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]++;
        int 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;
            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);
    int 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;
}
0