1323 条题解
-
-1Snake_Amadeus LV 4 @ 2015-07-22 16:55:02
#define POI <cstdio>
#define Poi 0
#define poooi main()
#define poi int
#define poipoi ,
#define poipoipoi ;
#define poipoipoipoi
#define poipoipoipoipoi scanf
#define poipoipoipoipoipoi printf
#define poipoipoipoipoipoipoi return
#define poipoipoipoipoipoipoipoi "%d%d"
#define poipoipoipoipoipoipoipoipoi "%d"
#define poipoipoipoipoipoipoipoipoipoi (
#define poipoipoipoipoipoipoipoipoipoipoi )
#define poipoipoipoipoipoipoipoipoipoipoipoi +
#define poipoipoipoipoipoipoipoipoipoipoipoipoi &
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoi a
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi b
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi {
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi }
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi using
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi namespace
#define poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi std
#include POI
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoi
poi
poipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoi
poi
poooi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoi
poipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoi
poipoi
poipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoi
poipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoi
poipoipoi
poipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoi
poipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
poipoipoipoipoipoipoipoipoipoipoi
poipoipoi
poipoipoipoipoipoipoi
Poi
poipoipoi
poipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoipoi
-
-12015-07-14 11:18:21@
#include<cstdio>
int pre[2000],sum[2000],next[2000],mis[200];
int x,n,t,m,y,k,a,b;
bool pd[200];
bool aa,bb;
int ax,ay,az,bx,by,bz,cx,cy,cz;
int max(int a,int b,int c=-100)
{
if(a>=b && a>=c) return a;
if(b>=a && b>=c) return b;
return c;
}
void swap()
{
if(x>y) {int p=x;x=y;y=p;}
}
void build(int i,int l,int r)
{
if (l==r) {int p;scanf("%d",&p);sum[i]=pre[i]=mis[i]=next[i]=p;return;}
int mid=l+r>>1;
build(i<<1,l,mid);
build(i<<1|1,mid+1,r);
mis[i]=max(mis[i<<1],mis[i<<1|1],next[i<<1]+pre[i<<1|1]);
pre[i]=max(pre[i<<1],sum[i<<1]+pre[i<<1|1]);
next[i]=max(next[i<<1|1],next[i<<1]+sum[i<<1|1]);
sum[i]=sum[i<<1]+sum[i<<1|1];
}
void change(int i,int x,int z,int l,int r)
{
if(l==r){pre[i]=mis[i]=next[i]=sum[i]=z;return;}
int mid=l+r>>1;
if(x<=mid) change(i<<1,x,z,l,mid);
else change(i<<1|1,x,z,mid+1,r);
mis[i]=max(mis[i<<1],mis[i<<1|1],next[i<<1]+pre[i<<1|1]);
pre[i]=max(pre[i<<1],sum[i<<1]+pre[i<<1|1]);
next[i]=max(next[i<<1|1],next[i<<1]+sum[i<<1|1]);
sum[i]=sum[i<<1]+sum[i<<1|1];
}
void query(int i,int x,int y,int l,int r)
{
if(x<=l && r<=y)
{
if(!t) {ax=mis[i];bz=next[i];}
else {bx=mis[i];by=pre[i];bz=next[i];}
cx=max(ax,bx,az+by);
cz=max(bz,sum[i]+az);
cx=max(cx,cz);
ax=cx;
az=cz;
t++;
return;
}
int mid=l+r>>1;
if(x<=mid) query(i<<1,x,y,l,mid);
if(y>mid) query(i<<1|1,x,y,mid+1,r);
}
int main()
{
build(1,1,2);
query(1,1,2,1,2);
printf("%d",mis[1]);
} -
-12015-06-14 15:31:03@
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
cout << a + b << endl;
return 0;
} -
-12015-05-18 13:14:31@
难度为9也,最难的题目了,我这个蒟蒻做不出来呢。。
大神们求教:
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a+b;
return 0
}
为什么没有错? -
-12015-05-08 17:33:46@
#include <stdio.h>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return 0;
} -
-12014-11-04 21:15:57@
###Plus A+B
#include <stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d",a+b);
return 0;
} -
-12014-11-03 18:50:28@
program Plus;
var a,b:longint;
begin
readln(a,b);
writeln(a+b);
end. -
-12014-10-30 18:21:36@
var
a,b:integer;
begin
rea(a,b);
writeln(a+b);
end. -
-12014-10-29 16:28:12@
123 500
-
-12014-10-29 13:11:47@
var x,y,z:integer;
begin
readln(x,y);
z:=x+y;
write(z);
end. -
-12014-10-28 17:42:30@
var a,b,c:longint;
begin
read(a,b);
c:=a+b;
writeln(c);
end. -
-12014-10-27 20:48:43@
#include<iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a+b;
return 0;
} -
-12014-10-27 15:17:55@
var
a,b:longint;
begin
read(a,b);
write(a+b);
end. -
-12014-10-25 19:45:05@
var a,b:longint;
begin
read(a,b);
writeln(a+b);
end. -
-12014-10-22 23:06:21@
Block code
水题
var
i,s,a,b:longint;
begin
readln(a,b);
s:=0;
for i:=1 to a do
inc(s);
for j:=1 to b do
inc(s);
write(s);
end. -
-12014-10-21 14:05:57@
include <stdio.h>
int main()
{
int a,b;
long c;
scanf("%d%d",&a,&b);
c=a+b;
printf("%ld",c);
return 0;
} -
-12014-10-20 18:33:19@
sdf
-
-12014-10-19 15:09:20@
program aaa;
var
p,a,b:longint;
begin
randomize;
readln(a,b);
p:=random(100);
if p<=60 then
writeln(a+b);
end. -
-12014-10-14 14:14:20@
var a,b:longint;
begin
readln(a,b,);
writeln(a+b);
end. -
-12014-10-11 10:37:08@
program p1000;
var
a,b:longint;
begin
readln(a,b);
writeln(a+b);
end.
信息
- ID
- 1000
- 难度
- 9
- 分类
- (无)
- 标签
- (无)
- 递交数
- 74449
- 已通过
- 28495
- 通过率
- 38%
- 被复制
- 223