332 条题解

  • 0
    @ 2016-08-01 20:20:03

    #include<iostream>
    using namespace std;
    int main()
    {
    int time[10],a,max=1;
    for(int i=1;i<=7;i++)
    cin>>time[i]>>a,time[i]+=a;
    for(int j=1;j<=7;j++)
    {
    if(time[j]>time[max])
    max=j;
    }
    if(time[max]>8)
    cout<<max;
    else cout<<0;

    }

  • 0
    @ 2016-07-28 21:19:33

    #include<iostream>
    using namespace std;int main(){int a[8],b[8];for(int i=1;i<=7;i++){cin>>a[i]>>b[i];}for(int i=1;i<=7;i++){if(a[i]+b[i]>8){cout<<i;return 0;}}cout<<0<<endl;return 0;}
    666

  • 0
    @ 2016-07-22 10:57:23

    Free Pascal Compiler version 3.0.0 [2015/11/16] for i386
    Copyright (c) 1993-2015 by Florian Klaempfl and others
    Target OS: Win32 for i386
    Compiling foo.pas
    foo.pas(6,8) Warning: Variable "i" does not seem to be initialized
    foo.pas(8,9) Warning: Variable "s1" does not seem to be initialized
    foo.pas(9,8) Warning: Variable "big" does not seem to be initialized
    Linking foo.exe
    13 lines compiled, 0.0 sec, 27536 bytes code, 1268 bytes data
    3 warning(s) issued

    测试数据 #0: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    测试数据 #1: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    测试数据 #2: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    测试数据 #3: Accepted, time = 15 ms, mem = 804 KiB, score = 10

    测试数据 #4: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    测试数据 #5: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    测试数据 #6: Accepted, time = 0 ms, mem = 804 KiB, score = 10

    测试数据 #7: Accepted, time = 0 ms, mem = 804 KiB, score = 10

    测试数据 #8: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    测试数据 #9: Accepted, time = 0 ms, mem = 800 KiB, score = 10

    Accepted, time = 15 ms, mem = 804 KiB, score = 100

    代码
    var i,a,b,s,s1,big,bo:longint;
    begin
    repeat
    readln(a,b);
    s:=a+b;
    i:=i+1;
    if s>8 then begin
    s1:=s1+1;
    if big<s then begin big:=s; bo:=i; end;
    end;
    until i=7;
    if s1=0 then write(s1)
    else write(bo);
    end.

  • 0
    @ 2016-07-20 19:50:46
    #include <stdio.h>
    #include <stdlib.h>
    
    int main()
    {
        int i,j,biggest,a,b;
        int add[7];
        for(i=0;i<7;i++)
        {
            scanf("%d",&a);
            scanf("%d",&b);
            add[i]=a+b;
            //printf("%d\n",add[i]);
        }
        biggest=add[0];
        j=0;
        for(i=0;i<7;i++)
        {
            if(biggest<add[i])
            {
                biggest=add[i];
                j=i;
            }
        }
        if(biggest>8)
            printf("%d",j+1);
        else
            printf("%d",0);
        return 0;
    }
    
  • 0
    @ 2016-07-13 09:13:52

    #include<iostream>
    #include<cstdio>
    #include<cstring>
    using namespace std;
    int main(){
    int sct[13];
    int aft[13];
    int temp[13];
    int flag=0;
    int i;
    for(i=1;i<=7;i++){
    cin>>sct[i]>>aft[i];
    }
    for(i=1;i<=7;i++){
    temp[i]=sct[i]+aft[i];
    if(temp[i]>8){
    flag=i;
    cout<<i;
    break;
    }
    }

    return 0;
    }

  • 0
    @ 2016-06-14 13:49:54
    记录信息
    评测状态    Accepted
    题目  P1113 不高兴的津津
    递交时间    2016-06-14 13:48:29
    代码语言    C++
    评测机 ShadowShore
    消耗时间    0 ms
    消耗内存    508 KiB
    评测时间    2016-06-14 13:48:30
    评测结果
    编译成功
    
    测试数据 #0: Accepted, time = 0 ms, mem = 500 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 508 KiB, score = 10
    测试数据 #2: Accepted, time = 0 ms, mem = 500 KiB, score = 10
    测试数据 #3: Accepted, time = 0 ms, mem = 500 KiB, score = 10
    测试数据 #4: Accepted, time = 0 ms, mem = 504 KiB, score = 10
    测试数据 #5: Accepted, time = 0 ms, mem = 504 KiB, score = 10
    测试数据 #6: Accepted, time = 0 ms, mem = 504 KiB, score = 10
    测试数据 #7: Accepted, time = 0 ms, mem = 504 KiB, score = 10
    测试数据 #8: Accepted, time = 0 ms, mem = 500 KiB, score = 10
    测试数据 #9: Accepted, time = 0 ms, mem = 504 KiB, score = 10
    Accepted, time = 0 ms, mem = 508 KiB, score = 100
    代码
    #include <cstdio>
    #include <algorithm>
    using std :: sort;
    struct Not_happy
    {
      int t1,t2;
      int day;
    }JJ[8];
    bool cmp(Not_happy a,Not_happy b)
    {
      return a.t1+a.t2 > b.t1+b.t2;
    }
    int main()
    {
      for (int i = 1;i <= 7;i++)
      {
        JJ[i].day = i;
        scanf("%d%d",&JJ[i].t1,&JJ[i].t2);
      }
      sort(JJ+1,JJ+7,cmp);
      if (JJ[1].t1+JJ[1].t2 <= 8)
        printf("%d",0);
      else
        printf("%d",JJ[1].day);
      return 0;
    }
    
  • 0
    @ 2016-05-31 20:03:21

    #include<iostream>
    using namespace std;
    int main()
    {
    int a[10],b[10],max=0,maxi=0;
    for(int i=1;i<=7;i++)
    {
    cin>>a[i]>>b[i];
    if(a[i]+b[i]>8 && a[i]+b[i]>max)
    {
    max=a[i]+b[i];
    maxi=i;
    }
    }
    cout<<maxi;
    return 0;
    }

  • 0
    @ 2016-03-26 20:31:40

    水题
    var
    i,j,max:longint;
    a,b,c:array[1..10000] of longint;
    begin
    for i:=1 to 7 do begin
    read(a[i],b[i]);
    c[i]:=a[i]+b[i];
    end;
    max:=0;
    for i:=1 to 7 do begin
    if c[i]>max then begin
    max:=c[i];
    j:=i;
    end;
    end;
    if max>8 then write(j);
    if max<=8 then write('0');
    end.

  • 0
    @ 2016-03-24 19:48:38

    var
    t1,t2:integer;
    max,day:integer;
    i:integer;
    begin
    max:=0;
    day:=0;
    for i:=1 to 7 do
    begin
    readln(t1,t2);
    if (t1+t2>8) and (t1+t2>max)
    then
    begin
    max:=t1+t2;
    day:=i;
    end;
    end;
    writeln(day);
    end.

  • 0
    @ 2016-03-03 13:03:13

    #include<cstdio>
    using namespace std;
    int main(){
    int i,m,n,f=0;
    for(i=1;i<=7;i++){
    scanf("%d %d",&m,&n);
    if(m+n>8){
    f=1;
    printf("%d",i);
    return 0;
    }
    }
    if(f==0)printf("0");
    return 0;
    }不能再水了

  • 0
    @ 2016-03-02 14:28:00

    #include <iostream>
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <algorithm>
    #include <math.h>

    using namespace std;

    struct a{
    int day = 0,va = 0;
    };
    int main(){
    int tmpx,tmpm;
    a ans;
    for(int i = 1;i <= 7;i ++){
    scanf("%d%d",&tmpx,&tmpm);
    if(tmpx + tmpm > 8){
    if(ans.va < tmpx + tmpm) {
    ans.va = tmpx + tmpm;
    ans.day = i;
    }
    }
    }
    printf("%d",ans.day);
    return 0;
    }

  • 0
    @ 2016-02-18 15:42:17
    #include<stdio.h>
    int max(int& a,int b){if(a<b)return(a=b)|1;return 0;}
    int main(){
        int ans=0,mi;
        for(int a,b,i=0;i<7;++i){
            scanf("%d%d",&a,&b);
            if(max(ans,a+b)) mi=i;
        }
        if(ans<=8) puts("0");
        else printf("%d\n",++mi);
    }
    
  • 0
    @ 2016-01-10 21:47:41

    var
    i,h,c:longint;
    a,b:array [1..7] of longint;
    begin
    h:=0;
    for i:=1 to 7 do
    begin
    readln(a[i],b[i]);
    end;
    for i:=1 to 7 do
    begin
    c:=a[i]+b[i];
    if c>8
    then
    begin
    h:=i;
    break;
    end;
    end;
    writeln(h);
    readln;
    end.

  • 0
    @ 2015-10-18 20:27:27

    var
    a:array[1..10] of integer;
    max,i,x,y,ans:integer;
    begin
    max:=0;
    for i:= 1 to 7 do
    begin
    read(x,y);
    if(x+y<=8) then continue;
    if(x+y>8) and (x+y>max)
    then
    begin max:=x+y;
    ans:=i;
    if(max<=8) then write(0);
    if(max>8) then write(ans);
    end;
    end;
    end.

  • 0
    @ 2015-10-08 20:30:02

    C++:
    #include <iostream>
    using namespace std;
    int a[8],b[8];
    int js=0;
    int unhappyday=8;
    int main()
    {
    int i;
    for(i=1;i<=7;i++)
    cin>>a[i]>>b[i];
    for(i=1;i<=7;i++){
    if(a[i]+b[i]>8){
    if(a[i]+b[i]>js){
    js=a[i]+b[i];
    unhappyday=i;

    }

    if(a[i]+b[i]==js){
    if(i<unhappyday)
    unhappyday=i;

    }
    }

    }
    if(unhappyday==8)cout<<"0"<<endl;
    else cout<<unhappyday<<endl;
    return 0;
    }

  • 0
    @ 2015-09-12 10:29:01

    var
    max,x,y,i,day,flag:integer;
    begin
    max:=-10000;
    flag:=0;
    for i:=1 to 7 do
    begin
    read(x,y);
    if(x+y<=8) then continue;
    if(x+y>=8and(nax<x+y)then
    begin
    max:=x+y;
    day:=i;
    flag:=1;
    end;
    end;
    if flag=0 then write(0)else
    write(day);
    end.

  • 0
    @ 2015-09-12 10:18:45

    var
    max,x,y,i,day,flag:integer;
    begin
    max:=-10000;
    flag:=0;
    for i:=1 to 7 do
    begin
    read(x,y);
    if(x+y<=8) then continue;
    if(x+y>8)and(max<x+y)then
    begin
    max:=x+y;
    day:=i;
    flag:=1;
    end;
    end;
    if flag=0 then write(0)else
    write(day);
    end.

  • 0
    @ 2015-08-30 13:25:52

    program bugaoxing;
    var
    a:array[1..10] of integer;
    max,i,x,y,ans:integer;
    begin
    max:=0;
    for i:= 1 to 7 do
    begin
    read(x,y);
    if(x+y<=8) then continue;
    if(x+y>8) and (x+y>max)
    then
    begin max:=x+y;
    ans:=i;
    if(max<=8) then write(0);
    if(max>8) then write(ans);
    end;
    end;
    end.

  • 0
    @ 2015-08-26 17:32:24

    逐个比较就行了,没那么难,虽然是普及组的题,但也挺简单的。顺便问一下,谁玩过生死狙击?在双线一区就好了。
    #include<cstdio>
    using namespace std;
    int main()
    {
    int sum,k,a[8][3],i,max;
    bool b;
    max=-1;
    b=true;
    for(i=1;i<=7;i++)
    {
    scanf("%d%d",&a[i][1],&a[i][2]);
    k=a[i][1]+a[i][2];
    if(k>8)
    {
    b=false;
    if(k>max)
    {
    max=k;
    sum=i;
    }
    }
    }
    if(b==true)
    printf("%d",0);
    else
    printf("%d",sum);
    return 0;

    }

  • 0
    @ 2015-08-26 15:00:43

    var
    max,x,y,i,day,flag:integer;
    begin
    max:=-10000;
    flag:=0;
    for i:=1 to 7 do
    begin
    read(x,y);
    if(x+y<=8)then continue;
    if(x+y>8)and(max<x+y) then
    begin
    max:=x+y;
    day:=i;
    flag:=1;
    end;
    end;
    if flag=0then write(0)else
    write(day);
    end.

信息

ID
1113
难度
2
分类
模拟 点击显示
标签
递交数
11399
已通过
6745
通过率
59%
被复制
39
上传者