题解

1323 条题解

  • 0
    @ 2013-10-30 17:00:46

    program Plus;
    var a,b:longint;
    begin
    readln(a,b);
    writeln(a+b);
    end.

  • 0
    @ 2013-10-30 15:52:05

    var a,b,c:longint;
    begin
    readln(a,b);
    c:=a+b;
    writeln(c);
    end.

  • 0

    #include<stdio.h>
    #include<iostream>
    #include<memory.h>
    using namespace std;
    int main()
    {
    int i,j;
    scanf("%d %d\n",&a,&j);
    printf("%d\n"i+j);
    }

  • 0
    @ 2013-10-19 21:08:35

    include <iostream> include <cmath> include <stdio.h>
    using namespace std;
    int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
    }

  • 0
    @ 2013-10-19 21:07:56

    include <iostream> include <cmath> include <stdio.h>
    using namespace std;
    int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    system("pause");
    return 0;
    }

  • 0
    @ 2013-10-19 21:06:16

    #include<stdio.h>
    #include <iostream>
    using namespace std;
    int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
    }

  • 0
    @ 2013-10-13 20:55:05

    var a,b:longint;
    begin
    readln(a,b);
    writeln(a+b);
    end.

  • 0
    @ 2013-09-28 14:33:50

    竟然错啦!!

  • 0
    @ 2013-09-27 14:51:28

    program Plus;
    var a,b:longint;
    begin
    readln(a,b);
    writeln(a+b);
    end.

  • 0
    @ 2013-09-07 23:16:58

    卖萌解法:
    #include <iostream>
    #include <cstdlib>
    #include <math.h>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */
    int a,b;
    double c;
    int main(int argc, char *argv[]) {
    cin>>a;
    cin>>b;
    c=pow(pow(a,2)+2*a*b+pow(b,2),0.5);
    cout<<c<<endl;
    return 0;
    }

  • 0
    @ 2013-08-31 14:02:33
  • 0
    @ 2013-08-19 14:43:13

    main(int a,int b){scanf("%d%d",&a,&b);printf("%d\n",a+b);}

  • 0
    @ 2013-08-18 23:12:38

    var
    en,et,ec,eu,ep,ex:Array[0..250000] of longint;
    dis:array[0..1000] of longint;
    v:array[0..1000] of boolean;
    i,j,k,n,m,w,cost,l:longint;
    a,b,ans,left,right:longint;

    function min(a,b:longint):longint;
    begin
    if a<b then min:=a else min:=b
    end;

    procedure addedge(s,t,c,u,k:longint);
    begin
    inc(l);
    en[l]:=en[s];
    en[s]:=l;
    et[l]:=t;
    ec[l]:=c;
    eu[l]:=u;
    ep[l]:=l+k;
    end;

    procedure build(s,t,u,c:longint);
    begin
    addedge(s,t,c,u,1);
    addedge(t,s,-c,0,-1);
    end;
    function aug(no,m:longint):longint;
    var
    i,d:longint;
    begin
    if no=n then
    begin
    inc(cost,m*dis[1]);
    exit;
    end;
    v[no]:=true;
    i:=ex[no];
    while i<>0 do
    begin
    if (eu[i]>0)and not v[et[i]] and(dis[et[i]]+ec[i]=dis[no]) then
    begin
    d:=aug(et[i],min(m,eu[i]));
    if d>0 then
    begin
    dec(eu[i],d);
    inc(eu[ep[i]],d);
    ex[no]:=i;
    exit(d);
    end;
    end;
    i:=en[i];
    end;
    ex[no]:=i;
    exit(0);
    end;

    function modlabel:boolean;
    var
    d,i,j:longint;
    begin
    d:=maxlongint;
    for i:=1 to n do
    if v[i] then
    begin
    j:=en[i];
    while j<>0 do
    begin
    if (eu[j]>0)and not v[et[j]] and(ec[j]-dis[i]+dis[et[j]]<d) then
    d:=ec[j]-dis[i]+dis[et[j]];
    j:=en[j]
    end;
    end;
    if d=maxlongint then exit(true);
    for i:=1 to n do
    if v[i] then
    begin
    v[i]:=false;
    inc(dis[i],d);
    end;
    exit(false);
    end;

    function work:longint;
    var i:longint;
    begin
    cost:=0;
    repeat
    for i:=1 to n do ex[i]:=en[i];
    while aug(1,maxlongint)>0 do
    fillchar(v,sizeof(v),0);
    until modlabel;
    work:=cost;
    end;

    function solve(x,d:longint):longint;
    var i,k,t,p,last,cost,lk:longint;
    begin
    fillchar(en,sizeof(en),0);
    fillchar(dis,sizeof(dis),0);
    k:=0; n:=2; t:=x; p:=0;
    while x<>0 do
    begin
    k:=k+x mod 10;
    x:=x div 10;
    inc(p);
    end;
    n:=1; x:=t; l:=k+p+1; last:=1; cost:=1; lk:=0;
    while x<>0 do
    begin
    k:=x mod 10;
    for i:=1 to k do
    begin
    inc(n);
    build(last,n,1,-cost);
    build(n,last+k+1,1,0);
    end;
    cost:=cost*10;
    inc(n);
    if last<>1 then
    begin
    if lk<k then
    build(1,last,k-lk,0);
    if k<lk then
    build(last,n,lk-k,0);
    end;
    last:=n; x:=x div 10;
    if lk<k then lk:=k;
    end;
    build(1,n,1,d);
    solve:=-work;
    end;

    begin
    readln(a,b);
    left:=1; right:=1000000000;
    while right-left>15000 do
    begin
    ans:=(left+right)shr 1;
    if solve(ans,b)>a then
    right:=ans
    else left:=ans;
    end;
    for i:=left to right do
    if solve(i,b)=a then
    begin
    writeln(i);
    halt;
    end;
    end.
    好难啊

  • 0
    @ 2013-08-18 23:08:45

    var
    a,b,x:longint;
    begin
    readln(a,b);
    randomize;
    repeat
    x:=random(a+b+1);
    if x=a+b then
    begin
    writeln(x);
    halt;
    end;
    until false;
    end.

    • @ 2013-11-04 21:04:41

      牛逼!!!!!!!!!

  • 0
    @ 2013-08-16 09:08:18

    #include <iostream>
    #include <algorithm>
    #include <cstdlib>
    #include <cstdio>
    #include <cmath>
    #include <cstring>
    using namespace std;
    int i,la,lb,tmp=0,x[10001],y[10001],ans[10001];
    void hplus(char a[],char b[])
    {
    la=strlen(a); lb=strlen(b); strrev(a); strrev(b);
    for(i=0;i<la;i++) if(a[i]!='-') x[i]=a[i]-48;
    for(i=0;i<lb;i++) if(b[i]!='-') y[i]=b[i]-48;
    for(i=0;i<=max(la,lb);i++){
    ans[i]=tmp+x[i]+y[i];
    tmp=ans[i]/10; ans[i]%=10;
    }
    tmp=max(la,lb);
    while(!ans[tmp] && tmp>0) tmp--;
    for(i=tmp;i>=0;i--) printf("%d",ans[i]);
    }
    void hminus(char a[],char b[])
    {
    la=strlen(a); lb=strlen(b); strrev(a); strrev(b);
    for(i=0;i<la;i++) if(a[i]!='-') x[i]=a[i]-48;
    for(i=0;i<lb;i++) if(b[i]!='-') y[i]=b[i]-48;
    for(i=0;i<=max(la,lb);i++){
    if(x[i]-y[i]<0){
    ans[i]+=((10+x[i])-y[i]);
    ans[i+1]=-1;
    }
    else ans[i]=ans[i]+(x[i]-y[i]);
    }
    tmp=max(la,lb);
    while(!ans[tmp] && tmp>0) tmp--;
    for(i=tmp;i>=0;i--) printf("%d",ans[i]);
    }
    int main()
    {
    char in1[10001],in2[10001];
    scanf("%s%s",&in1,&in2);
    if(in1[0]!='-' && in2[0]!='-') hplus(in1,in2);
    if(in1[0]=='-' && in2[0]=='-'){printf("-"); hplus(in1,in2);}
    if(in1[0]!='-' && in2[0]=='-'){
    if(abs(atoi(in1))>=abs(atoi(in2))) hminus(in1,in2);
    else{printf("-"); hminus(in2,in1);}
    }
    if(in1[0]=='-' && in2[0]!='-'){
    if(abs(atoi(in1))>=abs(atoi(in2))){printf("-"); hminus(in1,in2);}
    else hminus(in2,in1);
    }
    printf("\n");
    // system("pause");
    return 0;
    }

  • 0
    @ 2013-08-09 21:40:36

    不开longint的默默吃翔去吧

  • 0
    @ 2013-08-08 17:06:56

    #include <iostream>
    #include <cmath>
    #include <stdio.h>
    using namespace std;
    int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    system("pause");
    return 0;
    }

  • 0
    @ 2013-08-03 22:01:22

    其实可以随机函数 设置种子那里....处理一下

  • 0
    @ 2013-07-30 18:11:03

    评测结果
    VijosEx via JudgeDaemon2/13.7.4.0 via libjudge

    编译成功

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

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

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

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

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

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

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

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

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

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

    Accepted, time = 0 ms, mem = 732 KiB, score = 100

    纪念一下

  • 0
    @ 2013-04-04 22:39:41

    其实(a+b)应该保存成**long**型的吧。。。
    以此纪念重归vijos通过第一题~

信息

ID
1000
难度
9
分类
(无)
标签
(无)
递交数
74446
已通过
28492
通过率
38%
被复制
223