505 条题解

  • 0
    @ 2006-06-26 11:48:40

    一定用longint呀,数据太变态了!!!!!

  • 0
    @ 2006-05-28 08:21:53

    模拟

    其中涉及简单的字符处理,特别要注意数据类型的应用.如:学生姓名可采用char和string相结合的方法处理,奖学金金额用longint较为适宜.

  • 0
    @ 2006-05-26 22:09:17

    为虾米读不入?HELP ME!

  • 0
    @ 2006-05-20 20:15:58

    不要把“Y”___|_---|--"y"!!

  • 0
    @ 2006-01-26 10:07:25

    以前见过某某人的一段word suffle.

    就是直接读入一段单词(pascal里面这个东西并不算太容易考虑,意外太多——C/C++就......)

    这个过程容易写的

    至于主体...

    当有闲情的时候可以考虑看看使用heap拉BST拉线段树拉.......

    想最近两年来NOIp的送分题,事后我都能写个300+的程序来解决问题...

    什么叫 简单问题复杂化.. 哼哼

  • -1
    @ 2022-01-10 21:08:08

    //n年没碰Pascal用Pascal做一遍(忘记用Pos函数真的很吃亏)
    var
    cd:array[1..100]of longint;//每条的长度
    mc:array[1..100]of longint;//每个学生名字的长度
    kg:array[1..100,1..5]of longint;//每行all的空格的位置
    nn:array[1..100,1..999999]of char;
    qp:array[1..100]of longint;//期末平均成绩
    bp:array[1..100]of longint;//班级评议成绩
    gb:array[1..100]of char;//学生干部
    xs:array[1..100]of char;//西部学生
    lw:array[1..100]of integer;//论文数
    jxj:array[1..100]of longint;//总共奖学金数
    n,i,m,max,sum,a,b,l,j:longint;
    s:string;
    begin
    readln(n);
    for i:=1 to n do
    begin
    readln(s);
    cd[i]:=length(s);
    a:=1;b:=1;
    repeat
    if (s[a]=' ')then
    begin
    kg[i,b]:=a;
    b:=b+1;
    end;
    a:=a+1;
    until b=6;
    mc[i]:=kg[i,1]-1;
    for j:=1 to mc[i] do nn[i,j]:=s[j];
    val(s[(kg[i,1]+1)..(kg[i,2]-1)],qp[i],l);
    val(s[(kg[i,2]+1)..(kg[i,3]-1)],bp[i],l);
    gb[i]:=s[kg[i,3]+1];
    xs[i]:=s[kg[i,4]+1];
    if (kg[i,5]+1=cd[i])then val(s[cd[i]],lw[i],l)
    else lw[i]:=10;
    end;
    for i:=1 to n do
    begin
    if(qp[i]>80)and(lw[i]>=1)then jxj[i]:=jxj[i]+8000;
    if(qp[i]>85)and(bp[i]>80)then jxj[i]:=jxj[i]+4000;
    if qp[i]>90 then jxj[i]:=jxj[i]+2000;
    if(qp[i]>85)and(xs[i]='Y')then jxj[i]:=jxj[i]+1000;
    if(bp[i]>80)and(gb[i]='Y')then jxj[i]:=jxj[i]+850;
    end;
    max:=0;
    for i:=1 to n do
    begin
    sum:=sum+jxj[i];
    if max<jxj[i] then
    begin
    max:=jxj[i];
    m:=i;
    end;
    end;
    for i:=1 to mc[m] do write(nn[m,i]);
    writeln;
    writeln(jxj[m]);
    writeln(sum);
    end.

  • -1
    @ 2021-10-22 14:15:59

    #include <iostream>
    #include <string>
    using namespace std;
    string name[100],c1,c2;
    int p1[100],p2[100],cnt[100],n,maxty=-1, maxMoney=-1,tmpMoney,sumMoney=0;
    bool b1[100],b2[100];

    int main()
    {
    cin >> n;
    for (int i = 0; i < n; i ++)
    {
    cin >> name[i] >> p1[i] >> p2[i] >> c1 >> c2 >> cnt[i];
    b1[i] = (c1[0] == 'Y');
    b2[i] = (c2[0] == 'Y');
    tmpMoney = 0;
    if (p1[i] > 80 && cnt[i] >= 1)
    tmpMoney += 8000;
    if (p1[i] > 85 && p2[i] > 80)
    tmpMoney += 4000;
    if (p1[i] > 90)
    tmpMoney += 2000;
    if (p1[i] > 85 && b2[i] == true)
    tmpMoney += 1000;
    if (p2[i] > 80 && b1[i] == true)
    tmpMoney += 850;
    if (tmpMoney > maxMoney) {
    maxMoney = tmpMoney;
    maxty=i;
    }
    sumMoney += tmpMoney;
    }
    cout << name[maxty] << endl;
    cout << maxMoney << endl;
    cout << sumMoney << endl;
    return 0;
    }

  • -1
    @ 2020-04-24 21:51:11
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
    
    
  • -1
    @ 2019-03-25 19:08:56

    哪位大佬给看看 这么水的题只过了8个点 难受
    #include<stdio.h>
    #include<algorithm>
    #include<string.h>
    using namespace std;
    char a[105][105],b,c;
    int cnt[105];
    int main()
    {
    int n,x,y,z;
    scanf("%d",&n);
    memset(cnt,0,sizeof(cnt));
    int maxx=0;
    int sum=0;
    for(int i=1; i<=n; i++)
    {
    scanf("%s %d%d %c %c %d",a[i],&x,&y,&b,&c,&z);
    if(x>80&&z>0)
    cnt[i]+=8000;
    if(x>85&&y>80)
    cnt[i]+=4000;
    if(x>90)
    cnt[i]+=2000;
    if(c=='Y'&&x>85)
    cnt[i]+=1000;
    if(b=='Y'&&y>80)
    cnt[i]+=850;
    if(cnt[i]>maxx)
    maxx=cnt[i];
    sum+=cnt[i];

    }
    for(int i=1;i<=n;i++)
    {
    if(cnt[i]==maxx)
    printf("%s\n%d\n",a[i],cnt[i]);
    }
    printf("%d\n",sum);
    return 0;
    }

  • -1
    @ 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

    实在没事干搞个二分查找也可以的啊

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
39063
已通过
12711
通过率
33%
被复制
121
上传者