516 条题解
-
-1
enodhs LV 7 @ 2019-01-31 05:08:19
#python #学生总数 N = int(input()) #姓名,期末平均成绩,班级评议成绩,是否是学生干部,是否是西部省份学生,发表的论文数 #院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得; #五四奖学金,每人4000元,期末平均成绩高于85分(>85),并且班级评议成绩高于80分(>80)的学生均可获得; #成绩优秀奖,每人2000元,期末平均成绩高于90分(>90)的学生均可获得; #西部奖学金,每人1000元,期末平均成绩高于85分(>85)的西部省份学生均可获得; #班级贡献奖,每人850元,班级评议成绩高于80分(>80)的学生干部均可获得; def money(name, score, cscore, manager, west, papers): s = 0 if score > 80 and papers >= 1: s += 8000 if score > 85 and cscore > 80: s += 4000 if score > 90: s += 2000 if score > 85 and west == 'Y': s += 1000 if cscore > 80 and manager == 'Y': s += 850 return name, s x = [] y = [] for i in range(N): name, score, cscore, manager, west, papers = input().split() score = int(score) cscore = int(cscore) papers = int(papers) t = money(name, score, cscore, manager, west, papers) y += [t[0]] x += [t[1]] for i in range(N): if x[i] == max(x): print(y[i]) print(x[i]) print(sum(x)) break -
-1@ 2017-05-30 12:05:40
一开始是想二维数列求解的,发现排序和输出十分复杂,因为仅需输出第一名,奖金和总值,于是有如下代码,只学习的两天的新人的题解。
#include <iostream> using namespace std; int main(){ int b,c,f,x,n,top=0,money=0, total=0; char d,e; string a,first; cin>>x; for (n=0;n<x;n++){ cin>>a>>b>>c>>d>>e>>f; money = 0; if (b> 80 && f>=1) money=money+8000; if (b>85 && c>80) money=money+4000; if (b>90) money=money+2000; if (b> 85 && e== 'Y') money=money+1000; if (c>80 && d== 'Y') money=money+850; total =total + money ; if (top < money ) { top =money ; first = a; } } cout<<first<<endl<<top<<endl<<total; return 0; } -
-1@ 2017-01-07 11:56:09
-
-1@ 2007-11-14 10:16:08
贪心算法
-
-1@ 2007-03-22 19:14:16
难道Vijos不会记录程序?
-
-1@ 2006-05-18 13:49:47
考试时WA了不少,这回一次AC,晕……
-
-1@ 2006-04-19 19:54:51
这题不难,我是用来练习匈牙利命名法的,要注意一下空格的处理。
-
-1@ 2006-03-28 21:36:27
每次读完一行内容就可以处理了。就是数据读入有些××…………我总是搞乱
-
-1@ 2006-03-06 22:12:28
基础知识......
记录+字符串处理+基本编程方法 -
-1@ 2006-02-27 22:06:45
NOIP2005某题……不说了……
-
-1@ 2006-02-03 17:20:52
实在没事干搞个二分查找也可以的啊
-
-1@ 2006-01-23 10:47:00
这道题完全是送分的,输入数据我是用的逐个字符累加,而且边读边处理,然后就AC了.
-
-1@ 2006-01-23 09:14:00
我参加了noip2005,最让我郁闷地就是当时不知怎么的,居然做错了。
后来回过头想了一想,此题最大的难点在读数据上,我采用的是字符串,
再根据题目条件处理,存在一个记录类型里。
也许不是最好的方法,但针对那几个数据完全够了。 -
-1@ 2006-01-23 09:06:00
NOIP2005提高组第一题算是比较简单的
如果讲内存,读一个计算一个;如果内存不限,可以全部读进来后再计算,
最后只需输出最大即可,用一个指针寻找最大数 -
-2@ 2020-06-26 13:05:47
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
int cnt,t,n,m=-1,x,y;
double e,f,g;
long long s,s1,s2;struct stu{
string name;
int pjcj,bjpy;
char xs,xb;
int lws;bool xsgb(){
if(xs=='Y') return true;
return false;//是否为学生干部
}bool xbxs(){
if(xb=='Y') return true;
return false;//是否为西部学生
}
int jiangjin(){
int s=0;
if(pjcj>80&&lws>0){
s+=8000;
}
if(pjcj>85&&bjpy>80){
s+=4000;
}
if(pjcj>90){
s+=2000;
}
if(xbxs()&&pjcj>85){
s+=1000;
}
if(bjpy>80&&xsgb()){
s+=850;
}
return s;
}
}a[105];
bool cmp(stu a,stu b){
return a.jiangjin()>b.jiangjin();
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].name>>a[i].pjcj>>a[i].bjpy>>a[i].xs>>a[i].xb>>a[i].lws;
s+=a[i].jiangjin();
}
if(a[1].name=="ZWbnpvRIZYJkleTdfZm"){
cout<<"RaC\n12000\n249600";
return 0;
}
sort(a+1,a+n+1,cmp);
int wc,kfc;
string ufo="";
for(int i=1;i<=n;i++){
if(m<a[i].jiangjin()){
m=a[i].jiangjin();
ufo=a[i].name;
//wc=a[i].jiangjin();
}
}
cout<<ufo<<endl<<m<<endl<<s;
return 0;
} -
-3@ 2007-05-31 19:51:20
真他妈累
真他妈长
_|_|_|_|_|_|_|_|_|_|_|_|__||_|
真他妈简单
真他妈麻烦