记录编号 333369 评测结果 AAAAAAAAAA
题目名称 [NOIP 2005]谁拿了最多奖学金 最终得分 100
用户昵称 GravatarShallowStream 是否通过 通过
代码语言 C++ 运行时间 0.011 s
提交时间 2016-10-30 17:31:24 内存使用 0.31 MiB
显示代码纯文本
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>

using namespace std;

typedef struct
{
    string name;
    int Avs;
    int Cls;
    char sof;
    char wes;
    int textn;
}human;

int main()
{
    freopen("scholar.in", "r", stdin);
    freopen("scholar.out", "w", stdout);
    int n;
    cin>>n;
    human m[101];
    int money[101];
    int tot = 0;
    memset(money, 0, sizeof(money));
    for(int i = 0; i < n; ++i)
    {
        cin>>m[i].name>>m[i].Avs>>m[i].Cls>>m[i].sof>>m[i].wes>>m[i].textn;
        if( m[i].Avs > 80 && m[i].textn >= 1 ) money[i] += 8000;
        if( m[i].Cls > 80 && m[i].Avs >85 ) money[i] +=4000;
        if( m[i].Avs > 90) money[i] += 2000;
        if( m[i].Avs > 85 && m[i].wes == 'Y') money[i] +=1000;
        if( m[i].Cls > 80 && m[i].sof == 'Y') money[i] +=850;
        tot += money[i];
    }
    int max1 = *max_element(money, money + n);
    int maxst = max_element(money, money + n) - money;
    cout<<m[maxst].name<<endl<<max1<<endl<<tot<<endl;
}