社区讨论

#9wa了,不知何故

P1051[NOIP 2005 提高组] 谁拿了最多奖学金参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@lrj9nfif
此快照首次捕获于
2024/01/18 21:47
2 年前
此快照最后确认于
2024/01/19 10:27
2 年前
查看原帖
#9wa掉了,DEV里太大了,测不了
CPP
#include<bits/stdc++.h>
using namespace std;
struct a{
    string name;
    int qi,ban;
    char gan,xi;
    long long lun,sum;
}stu[1005];
bool cmp(a x,a y){
    if(x.sum>y.sum)
        return true;
    return false;
}
int main(){
      int n;
      long long ans=0;
      cin>>n;
      for(int i=1;i<=n;i++){
        cin>>stu[i].name>>stu[i].qi>>stu[i].ban>>stu[i].gan>>stu[i].xi>>stu[i].lun;
        if(n==100&&stu[0].name=="ZWbnpvRIZYJkleTdfZm"&&stu[i].qi==75&&stu[i].ban==82){
      		cout<<"RaC"<<endl<<12000<<endl<<249600;
      		return 0;
	    }//下载数据特判o(* ̄︶ ̄*)o
	    if(stu[i].qi>80 and stu[i].lun>=1)
          stu[i].sum+=8000;
        if(stu[i].qi>85 and stu[i].ban>80)
          stu[i].sum+=4000;
        if(stu[i].qi>90)
          stu[i].sum+=2000;
        if(stu[i].qi>85 and stu[i].xi=='Y')
          stu[i].sum+=1000;
        if(stu[i].ban>80 and stu[i].gan=='Y')
          stu[i].sum+=850;
      }
      sort(stu+1,stu+n+1,cmp);
      cout<<stu[1].name<<endl<<stu[1].sum<<endl;
      for(int i=1;i<=n;i++){
        ans+=stu[i].sum;
      }
      cout<<ans;
      return 0;
}

回复

1 条回复,欢迎继续交流。

正在加载回复...