192 条题解

  • 0
    @ 2009-09-25 21:12:12

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    var

    a:array[1..10]of string[15];

    i,j,k,np,n,q,p:integer;

    aa:array[1..10]of longint;

    c:string;

    begin

    fillchar(aa,sizeof(aa),0);

    readln(np);

    for i:=1 to np do

    readln(a[i]);

    for i:=1 to np do

    begin

    readln(c);

    j:=1;

    while (a[j]c) do

    j:=j+1;

    readln(q,n);

    aa[j]:=aa[j]-q;

    if (n0)then

    begin

    p:=q div n;

    aa[j]:=aa[j]+q mod n;

    end;

    for k:=1 to n do

    begin

    readln(c);

    j:=1;

    while (a[j]c)do

    j:=j+1;

    aa[j]:=aa[j]+p;

    end;

    end;

    for i:=1 to np do

    writeln(a[i],' ',aa[i]);

    end.

    这个题不难,就是麻烦……

    于是交了去年的题解

    感觉今年的做题状态竟然还不如去年了

  • 0
    @ 2009-09-22 16:41:22

    var st,st2:string;

    s:array[1..100]of string;

    x:array[1..100]of longint;

    a,b,n:longint;i,j,k:longint;

    begin

    fillchar(x,sizeof(x),0);

    readln(n);

    for i:=1 to n do readln(s[i]);

    for i:=1 to n do

    begin

    readln(st);

    readln(a,b);

    for j:=1 to n do

    if st=s[j] then

    begin

    if b>0 then x[j]:=x[j]-(a-a mod b);

    break;

    end;

    for j:=1 to b do

    begin

    readln(st2);

    for k:=1 to n do

    if st2=s[k] then

    begin

    if b>0 then x[k]:=x[k]+(a div b);

    break;

    end;

    end;

    end;

    for i:=1 to n do

    writeln(s[i],' ',x[i]);

    end.

  • 0
    @ 2009-09-13 15:33:49

    var nam:array[1..10] of string;

    qian:array[1..10] of integer;

    i,j,q,r,n,k,z:integer;

    m:string;

    begin

    readln(n);

    for i:=1 to n do begin

    readln(nam[i]);

    qian[i]:=0;

    end;

    for i:=1 to n do

    begin

    readln(m);

    readln(q,r);

    if r>0 then begin

    for j:=1 to n do if m=nam[j] then qian[j]:=qian[j]-(q div r)*r;

    for j:=1 to r do

    begin

    readln(m);

    for z:=1 to n do if m=nam[z] then

    qian[z]:=qian[z]+q div r;

    end;

    end;

    end;

    for i:=1 to n do writeln(nam[i],' ',qian[i]);

    end.

    {因为刚开始一直忘了等于0的情况,而一直过不了)

  • 0
    @ 2009-09-12 12:57:05

    #include

    #include

    using namespace std;

    int main()

    { string name[11];

    long int money[11]={0};

    string mn;

    int np,a,b,c,x,z;

    cin>>np;

    for(int i=1;i>name[i];

    for(int i=1;i>mn;

    for(int j=1;j>a>>b;

    if(b!=0)

    {

    c=a/b;

    x=b*c;

    money[z]-=x;

    for(int k=1;k>mn;

    for(int j=1;j

  • 0
    @ 2009-09-11 15:38:49

    水~

  • 0
    @ 2009-09-02 21:34:46

    笑苍生

    var st,st2:string;

    s:array[1..100]of string;

    x:array[1..100]of longint;

    a,b,n:longint;i,j,k:longint;

    begin

    fillchar(x,sizeof(x),0);

    readln(n);

    for i:=1 to n do readln(s[i]);

    for i:=1 to n do

    begin

    readln(st);

    readln(a,b);

    for j:=1 to n do

    if st=s[j] then

    begin

    if b>0 then x[j]:=x[j]-(a-a mod b);

    break;

    end;

    for j:=1 to b do

    begin

    readln(st2);

    for k:=1 to n do

    if st2=s[k] then

    begin

    if b>0 then x[k]:=x[k]+(a div b);

    break;

    end;

    end;

    end;

    for i:=1 to n do

    writeln(s[i],' ',x[i]);

    end.

  • 0
    @ 2009-08-28 16:41:19

    program fe;

    type

    data=record

    name:string[14];

    hold:integer;

    last:integer;

    get:integer;

    end;

    var

    d:array[1..10] of data;

    n:integer;

    procedure make;

    var

    i,m,num,j:integer;st:string[14];ch:char;

    begin

    readln(input,n);

    for i:=1 to n do

    begin

    readln(input,st);

    d[i].name:=st;d[i].get:=0;

    end;

    while not eof do

    begin

    readln(input,st);

    i:=0;

    repeat

    inc(i);

    until d[i].name=st;

    readln(input,m,num);

    d[i].hold:=m;

    if num0 then begin

    d[i].last:=m-num*(m div num);

    m:=m div num;

    for j:=1 to num do

    begin

    readln(input,st);

    i:=0;

    repeat

    inc(i);

    until d[i].name=st;

    inc(d[i].get,m)

    end;

    end;

    end;

    end;

    procedure outit;

    var

    i,j:integer;

    begin

    for i:= 1 to n do

    begin

    j:=d[i].get+d[i].last-d[i].hold;

    writeln(output,d[i].name,' ',j);

    end;

    end;

    begin

    make;

    outit;

    end.

    给点意见....

  • 0
    @ 2009-08-22 20:58:04

    看题目很耐心.

    做题目没耐心.

  • 0
    @ 2009-08-22 17:15:01

    注意一下人数不为0就OK了

  • 0
    @ 2009-08-15 08:50:25

    var st,st2:string;

    s:array[1..100]of string;

    x:array[1..100]of longint;

    a,b,n:longint;i,j,k:longint;

    begin

    fillchar(x,sizeof(x),0);

    readln(n);

    for i:=1 to n do readln(s[i]);

    for i:=1 to n do

    begin

    readln(st);

    readln(a,b);

    for j:=1 to n do

    if st=s[j] then

    begin

    if b>0 then x[j]:=x[j]-(a-a mod b);

    break;

    end;

    for j:=1 to b do

    begin

    readln(st2);

    for k:=1 to n do

    if st2=s[k] then

    begin

    if b>0 then x[k]:=x[k]+(a div b);

    break;

    end;

    end;

    end;

    for i:=1 to n do

    writeln(s[i],' ',x[i]);

    end.

    垃圾题……鄙视……

  • 0
    @ 2009-08-13 19:50:13

    编程复杂度稍微高些

    没难度

    水题

  • 0
    @ 2009-10-29 13:00:04

    .....不解释

    ......好吧我承认自己本来应该用Scanner,我用StringTokenizer纯粹是在装十三.

    ......楼下各位神牛的程序这么短小这么精悍,我的程序这么沙茶,我怎么办啊......

    import java.io.*;

    import java.util.*;

    class GiftGiver{

    public String name="";

    public int money=0;

    public int premoney=0;

    public GiftGiver(String s){

    name=s;

    money=0;

    premoney=0;

    }

    public void giveMoney(GiftGiver gg,int m){

    gg.money=gg.money+m;

    money=money-m;

    }

    public void setMoney(int m){

    money=money+m;

    premoney=m;

    }

    public int leftMoney(){

    return money-premoney;

    }

    }

    class gift1 {

    public static int n;

    public static GiftGiver[] pp;

    static int search(String s){

    for(int i=0;i

  • 0
    @ 2009-08-07 23:20:03

    var

    a,b,c,n,e,p,o:longint;

    x,y:array[1..10] of string;

    d,f:string;

    q,w:array[1..10] of longint;

    begin

    fillchar(q,sizeof(q),0);

    readln(n);

    for a:=1 to n do

    readln(x[a]);

    for a:=1 to n do

    begin

    readln(d);

    for b:=1 to n do

    if x=d then begin

    readln(p,c);

    q:=q-p;

    if c0 then

    begin

    e:=p div c;

    p:=p mod c;

    q:=q+p;

    end;

    end;

    if c0 then

    begin

    for p:=1 to c do

    begin

    readln(f);

    for o:=1 to n do

    if x[o]=f then q[o]:=q[o]+e;

    end;

    end;

    end;

    for a:=1 to n do

    writeln(x[a],' ',q[a]);

    end.

  • 0
    @ 2009-08-07 20:59:26

    100分啊!

    var

    n,i,j,m,k,t:longint;

    s:string;

    name:array[0..11]of string;

    chu,mo:array[0..11]of longint;

    function zhao(s:string):longint;

    var

    i:longint;

    begin

    for i:=1 to n do

    if name[i]=s then

    begin

    zhao:=i;

    exit;

    end;

    end;

    begin

    fillchar(chu,sizeof(chu),0);

    fillchar(mo,sizeof(mo),0);

    readln(n);

    for i:=1 to n do

    readln(name[i]);

    for i:=1 to n do

    begin

    readln(s);

    j:=zhao(s);

    readln(m,k);

    chu[j]:=m;

    if k>0 then

    inc(mo[j],m mod k);

    for j:=1 to k do

    begin

    readln(s);

    t:=zhao(s);

    inc(mo[t],m div k);

    end;

    end;

    for i:=1 to n do

    write(name[i],' ',mo[i]-chu[i]);

    end.

  • 0
    @ 2009-08-04 15:24:37

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

  • 0
    @ 2009-08-04 14:48:01

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ├ 测试数据 06:答案正确... 0ms

    ├ 测试数据 07:答案正确... 0ms

    ├ 测试数据 08:答案正确... 0ms

    ├ 测试数据 09:答案正确... 0ms

    ├ 测试数据 10:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    Program P1035;

    Var i,j,np,f,b:longint;

    temp:string;

    money,money1,a:array[1..10] of integer;

    nam,nam1:array[1..10] of string;

    Function Findname(str1:string):integer;

    Var i:integer;

    Begin

    for i:=1 to np do

    begin

    if (str1=nam[i]) then

    begin

    findname:=i;

    exit;

    end

    end;

    End;

    Begin

    readln(np);

    for i:=1 to np do readln(nam[i]);

    for i:=1 to np do

    begin

    readln(nam1[i]);

    b:=findname(nam1[i]);

    readln(money,f);

    money1:=money;

    for j:=1 to f do

    begin

    readln(temp);

    a[findname(temp)]:=a[findname(temp)]+money div f;

    end;

    if f0 then money:=money-(money div f)*f;

    end;

    for i:=1 to np do

    begin

    writeln(nam[i],' ' ,money[i]+a[i]-money1[i]);

    end;

    End.

  • 0
    @ 2009-08-03 11:13:51

    var n,i,r,f,k,j,w:longint; qian,qian1:array[0..20]of longint;

    st:array[0..20]of string; st2:string;

    begin

    readln(n);

    for i:=1 to n do readln(st[i]);

    for i:=1 to n do

    begin

    readln(st2);

    for j:=1 to n do if st[j]=st2 then w:=j;

    readln(qian[w],r);

    if r0 then f:=qian[w] div r;

    for j:=1 to r do

    begin

    readln(st2);

    for k:=1 to n do if st[k]=st2 then qian1[k]:=qian1[k]+f;

    end;

    qian[w]:=-f*r;

    end;

    for i:=1 to n do writeln(st[i],' ',qian[i]+qian1[i]);

    end.

  • 0
    @ 2009-08-01 17:26:00

    必须注意到:

    被0除和出钱人实际花的钱

  • 0
    @ 2009-07-31 15:09:37

    var

    n,i,j,m,k,t:longint;

    s:string;

    name:array[0..11]of string;

    chu,mo:array[0..11]of longint;

    function zhao(s:string):longint;

    var

    i:longint;

    begin

    for i:=1 to n do

    if name[i]=s then

    begin

    zhao:=i;

    exit;

    end;

    end;

    begin

    fillchar(chu,sizeof(chu),0);

    fillchar(mo,sizeof(mo),0);

    readln(n);

    for i:=1 to n do

    readln(name[i]);

    for i:=1 to n do

    begin

    readln(s);

    j:=zhao(s);

    readln(m,k);

    chu[j]:=m;

    if k>0 then

    inc(mo[j],m mod k);

    for j:=1 to k do

    begin

    readln(s);

    t:=zhao(s);

    inc(mo[t],m div k);

    end;

    end;

    for i:=1 to n do

    writeln(name[i],' ',mo[i]-chu[i]);

    end.

    从头开始,追逐梦想

信息

ID
1035
难度
2
分类
模拟 点击显示
标签
(无)
递交数
5222
已通过
2901
通过率
56%
被复制
19
上传者