F.A.Qs Home ProblemSet Status Ranklist Contest LoginRegister
Notice:1:注册本OJ方式请见https://www.lydsy.com/JudgeOnline/wttl/thread.php?tid=5671 2:请不要在讨论区中发空白主题帖。
大视野在线测评-欢迎您
[ New Thread ]
Problem 1000 >> 我这份代码CE了,求大神帮下忙,谢谢了
CuAgAu @ 2018-04-28 17:52:46
[ Quote ] [ Edit ] [ Delete ] 1#
这是我的代码:
#iclude <csdtio>
usong namesapce std;
inr mian()
{
inr a,b;
scnaf('^d^d',%a,%b);
pritnf('^d/n',a+b);
}
Cydiater @ 2018-04-28 18:16:06
[ Quote ] [ Edit ] [ Delete ] 2#
道理我都懂,但是你左括号怎么可以换行啊
EdwardFrog @ 2018-04-28 18:39:39
[ Quote ] [ Edit ] [ Delete ] 3#
我刀呢
EdwardFrog @ 2018-04-28 18:40:29
[ Quote ] [ Edit ] [ Delete ] 4#
楼主你把脑袋伸过来
WangXuanCe @ 2018-04-28 18:40:41
[ Quote ] [ Edit ] [ Delete ] 5#
我给你把刀送上去
strangers @ 2018-04-28 19:00:39
[ Quote ] [ Edit ] [ Delete ] 6#
楼主你把脑袋伸过来
XTYF_CKY @ 2018-04-28 20:13:07
[ Quote ] [ Edit ] [ Delete ] 7#
楼主ID不错(逃
ranvan @ 2018-04-29 19:12:58
[ Quote ] [ Edit ] [ Delete ] 8#
女装吧
132 @ 2018-04-29 20:27:07
[ Quote ] [ Edit ] [ Delete ] 9#
帮你改好了,亲测可以AC
#include <cstdio>
using namespace std;
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}
jkfz_lxt @ 2018-04-29 22:12:01
[ Quote ] [ Edit ] [ Delete ] 10#
帮你改好了,亲测可以AC
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cctype>
#include <vector>
#include <moha> //lz jiu shi xiang gao ge da xin wen
using namespace std;
const int maxn=1000005;
const int inf=0xfffffff;
int r,c,m,v;
int L,R;
struct Tmp{
Tmp() : sum(0), mx(-inf),mi(inf) {}
Tmp(int x,int y,int z) :sum(x),mx(y),mi(z) {}
int sum;
int mx,mi;
};
int sum[maxn<<2],add[maxn<<2],set[maxn<<2],mx[maxn<<2],mi[maxn<<2];
inline void up(int now){
sum[now]=sum[now<<1]+sum[now<<1|1];
mx[now]=max(mx[now<<1],mx[now<<1|1]);
mi[now]=min(mi[now<<1],mi[now<<1|1]);
return ;
}
void build(int now,int l,int r){
if(l==r){
mx[now]=0;//-inf;
mi[now]=0;//inf;
return ;
}
int mid=(l+r)>>1;
build(now<<1,l,mid);
build(now<<1|1,mid+1,r);
up(now);
return ;
}
inline void down(int now,int ln,int rn){
if(set[now]){
sum[now<<1]=set[now]*ln;
sum[now<<1|1]=set[now]*rn;
set[now<<1]=set[now];
set[now<<1|1]=set[now];
add[now<<1]=add[now<<1|1]=0;
mx[now<<1]=mx[now<<1|1]=set[now];
mi[now<<1]=mi[now<<1|1]=set[now];
set[now]=0;
}
if(add[now]){
sum[now<<1]+=add[now]*ln;
sum[now<<1|1]+=add[now]*rn;
add[now<<1]+=add[now];
add[now<<1|1]+=add[now];
mx[now<<1]+=add[now];
mi[now<<1]+=add[now];
mx[now<<1|1]+=add[now];
mi[now<<1|1]+=add[now];
add[now]=0;
}
return ;
}
void update_add(int now,int l,int r){
if(L<=l&&r<=R){
add[now]+=v;
sum[now]+=v*(r-l+1);
mx[now]+=v;
mi[now]+=v;
return ;
}
int mid=(l+r)>>1;
down(now,mid-l+1,r-mid);
if(L<=mid)update_add(now<<1,l,mid);
if(mid<R)update_add(now<<1|1,mid+1,r);
up(now);
return ;
}
void update_set(int now,int l,int r){
if(L<=l&&r<=R){
set[now]=v;
sum[now]=v*(r-l+1);
add[now]=0;
mx[now]=v;
mi[now]=v;
return ;
}
int mid=(l+r)>>1;
down(now,mid-l+1,r-mid);
if(L<=mid)update_set(now<<1,l,mid);
if(mid<R)update_set(now<<1|1,mid+1,r);
up(now);
return ;
}
Tmp query(int now,int l,int r){
if(L<=l&&r<=R){
return Tmp(sum[now],mx[now],mi[now]);
}
int mid=(l+r)>>1;
down(now,mid-l+1,r-mid);
Tmp tmp;
int sum=0,mx=-inf,mi=inf;
if(L<=mid){
tmp=query(now<<1,l,mid);
sum+=tmp.sum;
mx=max(mx,tmp.mx);
mi=min(mi,tmp.mi);
}
if(mid<R){
tmp=query(now<<1|1,mid+1,r);
sum+=tmp.sum;
mx=max(mx,tmp.mx);
mi=min(mi,tmp.mi);
}
// up(now);
tmp.sum=sum,tmp.mi=mi,tmp.mx=mx;
return tmp;
}
template <class T>inline void read(T &x){
x=0;int ne=0;char c;
while(!isdigit(c=getchar()))ne=c=='-';
x=c-48;
while(isdigit(c=getchar()))x=(x<<3)+(x<<1)+c-48;
x=ne?-x:x;
return ;
}
int main()
{
int op,x1,x2,y1,y2;
int p,q;
//read(r),read(c),read(m);
read(p),read(q);
r=1926,c=817,m=3;
// build(1,1,r*c);
while(m--){
// read(op),read(x1),read(y1),read(x2),read(y2);
if(m==2)op=1,x1=1,y1=1,x2=1,y2=1;
else if(m==1)op=1,x1=1,y1=2,x2=1,y2=2;
else op=3,x1=1,y1=1,x2=1,y2=2;
if(op==1){
//read(v);
if(m==2)v=q;
else v=p;
for(register int i=x1;i<=x2;i++){
L=(i-1)*c+y1,R=(i-1)*c+y2;
update_add(1,1,r*c);
}
}
else if(op==2){
read(v);
for(register int i=x1;i<=x2;i++){
L=(i-1)*c+y1,R=(i-1)*c+y2;
update_set(1,1,r*c);
}
}
else {
Tmp tmp;
int sum=0,mx=-inf,mi=inf;
for(register int i=x1;i<=x2;i++){
L=(i-1)*c+y1,R=(i-1)*c+y2;
tmp=query(1,1,r*c);
sum+=tmp.sum;
mx=max(mx,tmp.mx);
mi=min(mi,tmp.mi);
}
//printf("%d %d %d\n",sum,mi,mx);
printf("%d\n",sum);
}
}
return 0;
}
jjikkollp @ 2018-04-30 21:21:52
[ Quote ] [ Edit ] [ Delete ] 11#
道理我都懂,但是你左括号怎么可以换行啊
iot @ 2018-05-01 09:23:08
[ Quote ] [ Edit ] [ Delete ] 12#
大括号圣战!
float @ 2018-05-01 14:03:04
[ Quote ] [ Edit ] [ Delete ] 13#
道理我都懂,但是10楼你左括号怎么可以不换行啊
kaiming @ 2018-05-01 15:27:14
[ Quote ] [ Edit ] [ Delete ] 14#
感觉lz是个dalao的小号,准备造神贴
ezoixx130 @ 2018-05-01 15:35:21
[ Quote ] [ Edit ] [ Delete ] 15#
同CE,求助:
PROGRAM P1000
IMPLICIT NONE
INTEGER :: A, B
READ(*,*) A, B
WRITE(*, "(I0)") A + B
END PROGRAM P1000
skylee @ 2018-05-04 18:22:18
[ Quote ] [ Edit ] [ Delete ] 16#
道理我都懂,但是你左括号怎么可以换行啊
GXZlegend @ 2018-05-04 18:53:58
[ Quote ] [ Edit ] [ Delete ] 17#
帮你改好了,没亲测可以AC:
,>++++++[<-------->-],,[<+>-],<.>.
fengyuan @ 2018-05-10 14:14:47
[ Quote ] [ Edit ] [ Delete ] 18#
道理我都懂,但是你左括号怎么可以换行啊
zhouzhendong @ 2018-05-10 19:45:12
[ Quote ] [ Edit ] [ Delete ] 19#
道理我都懂,但是你左括号怎么可以换行啊
vjudge32768 @ 2018-05-11 22:38:17
[ Quote ] [ Edit ] [ Delete ] 20#
道理我都懂,但是你左括号怎么可以换行啊
XTYF_CKY @ 2018-05-17 09:49:27
[ Quote ] [ Edit ] [ Delete ] 21#
道理我都懂,但是你左括号就是应该换行啊
Mychael @ 2018-05-17 11:36:08
[ Quote ] [ Edit ] [ Delete ] 22#
道理我都懂,但是你左括号怎么可以换行啊
dxymaster @ 2018-05-17 17:11:28
[ Quote ] [ Edit ] [ Delete ] 23#
道理我都懂,但是你怎么能有缩进呢?
dxymaster @ 2018-05-17 17:11:52
[ Quote ] [ Edit ] [ Delete ] 24#
看别人十楼码风多好。
walker90 @ 2018-05-20 08:52:26
[ Quote ] [ Edit ] [ Delete ] 25#
道理我都懂,但是你左括号怎么可以换行啊
yzx_H2O @ 2018-05-20 21:04:04
[ Quote ] [ Edit ] [ Delete ] 26#
17楼这是BrainFxxk?
adoubiq @ 2018-05-21 15:01:41
[ Quote ] [ Edit ] [ Delete ] 27#
道理我都懂,但是你左括号就是应该换行啊
strangers @ 2018-05-21 15:35:17
[ Quote ] [ Edit ] [ Delete ] 28#
道理我都懂,但是你左括号就是应该换行啊
ranwen @ 2018-05-22 16:27:35
[ Quote ] [ Edit ] [ Delete ] 29#
道理我都懂,但是你左括号就是应该换行啊
this_problem_is_bad @ 2018-05-22 16:31:19
[ Quote ] [ Edit ] [ Delete ] 30#
这题太差了
EdwardFrog @ 2018-05-22 16:39:16
[ Quote ] [ Edit ] [ Delete ] 31#
这题太差了
Ez3real @ 2018-05-22 19:12:31
[ Quote ] [ Edit ] [ Delete ] 32#
道理我都懂,但是你为什么要用括号啊
OrzZsyDalao @ 2018-05-22 19:32:31
[ Quote ] [ Edit ] [ Delete ] 33#
道理我都懂,但是你左括号就是应该换行啊
l1ll5 @ 2018-05-22 19:58:27
[ Quote ] [ Edit ] [ Delete ] 34#
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊
OrzZsyDaIao @ 2018-05-22 20:12:25
[ Quote ] [ Edit ] [ Delete ] 35#
道理我都懂,但是你怎么能用C++啊
JustinGayver @ 2018-05-22 21:24:36
[ Quote ] [ Edit ] [ Delete ] 36#
道理我都懂,但是你左括号怎么可以换行啊
PhoenixGS @ 2018-05-23 09:23:04
[ Quote ] [ Edit ] [ Delete ] 37#
道理我都懂,但是你左括号就是应该换行啊
Michael_Bryant @ 2018-05-23 09:29:11
[ Quote ] [ Edit ] [ Delete ] 38#
道理我都懂,但是你左括号就是应该换行啊
RE_test @ 2018-05-24 09:39:42
[ Quote ] [ Edit ] [ Delete ] 39#
我这份代码CE了,求大神帮下忙
#oq3hnfoeawpppghwe9hs-zujh%hasbi9pks;
sh5U(A%HKSMtrn][k54khSK%)IJW(#%H;
\S$H{#$H_~IR)K#WdtykESHbhlnppppp8t0uagz-ug-b4eu-gz;
eg4o3h08esyhzgip(erg4%Y@m[ork5)gy[hb,s'hktjn;
{
s gXSTMNKop5k6n[k60hisko[ [otro[je6uhs,'rjk;
SJRTL:gkdfgnko[vkn[xkt',#YUR%E5yjhmt6rrrrtkgnv [g,xdkthnrrrhk;
s54kh'sHP%H{Kl'rhk9-5hobpm;x;
htkohj[rjho9jmt5r'hbrmw[3oyhkt6[ugm ntW%E$YU(^I%JE{TG"Sbl5n's,o;
yt6pjef,[tbok,m[ hl5JDRTHNO{6ijokrsohm[jojrom[s'];
}
EdwardFrog @ 2018-05-24 10:18:06
[ Quote ] [ Edit ] [ Delete ] 40#
↑脸滚键盘流↑
XTYF_CKY @ 2018-05-24 19:54:39
[ Quote ] [ Edit ] [ Delete ] 41#
↑脸滚键盘流↑
dxymaster @ 2018-05-25 11:47:40
[ Quote ] [ Edit ] [ Delete ] 42#
↑流盘键滚脸↑
dxymaster @ 2018-05-25 11:48:48
[ Quote ] [ Edit ] [ Delete ] 43#
{
↑脸滚键盘流↑
}
OwenOwl @ 2018-05-25 12:06:44
[ Quote ] [ Edit ] [ Delete ] 44#
我这份代码CE了,求大神帮下忙

#道理我都懂,但是你左括号怎么可以换行啊
道理我都懂,但是你左括号怎么可以换行啊;
道理我都懂,但是你左括号怎么可以换行啊() {
道理我都懂,但是你左括号怎么可以换行啊;
道理我都懂,但是你左括号怎么可以换行啊;
道理我都懂,但是你左括号怎么可以换行啊;
}
mcfxmcfxmcfx @ 2018-05-25 12:15:38
[ Quote ] [ Edit ] [ Delete ] 45#
#道理我都懂,但是你左括号就是应该换行啊
道理我都懂,但是你左括号就是应该换行啊;
道理我都懂,但是你左括号就是应该换行啊()
{
道理我都懂,但是你左括号就是应该换行啊;
道理我都懂,但是你左括号就是应该换行啊;
道理我都懂,但是你左括号就是应该换行啊;
}
改好了
实测不会ce
CuAgAu @ 2018-05-25 18:05:04
[ Quote ] [ Edit ] [ Delete ] 46#
@所有人
谢谢各位大神的好心。。
我在百度上搜了好长时间,终于找到一个好像不会ce的代码了。。可是他MLE了。。。
于是我把数组改小了一些,不会MLE了,却RE了。。。
谁来帮帮我。。。唉,lz真心是没办法了。。。
这是代码:
#include <iostream>
#include <cstdio>
using namespace std;
int c[25][2],fa[25],rev[25],val[25],sum[25],s[25];
bool isroot(int x)
{
return c[fa[x]][0]!=x&&c[fa[x]][1]!=x;
}
bool son(int x,int y)
{
return c[x][1]==y;
}
void up(int x)
{
sum[x]=val[x]+sum[c[x][0]]+sum[c[x][1]];
}
void down(int x)
{
if(!rev[x]) return;
rev[x]^=1;
rev[c[x][0]]^=1;
rev[c[x][1]]^=1;
swap(c[x][0],c[x][1]);
}
void rotate(int x)
{
int y=fa[x],z=fa[y],a=son(y,x),b=!a;
if(!isroot(y)) c[z][son(z,y)]=x;
fa[x]=z;fa[y]=x;fa[c[x][b]]=y;
c[y][a]=c[x][b];c[x][b]=y;
up(y);up(x);
}
void splay(int x)
{
int top=0;s[++top]=x;
for(int i=x;!isroot(x);i=fa[i]) s[++top]=fa[i];
while(top) down(s[top--]);
while(!isroot(x))
{
int y=fa[x],z=fa[y];
if(!isroot(y))
{
if(son(z,y)^son(y,x)) rotate(y);
else rotate(x);
}
rotate(x);
}
}
void access(int x)
{
for(int y=0;x;y=x,x=fa[x])
{
splay(x);
c[x][1]=y;
up(x);
}
}
void setroot(int x)
{
access(x);
splay(x);
rev[x]^=1;
}
void spilt(int x,int y)
{
setroot(x);
access(y);
splay(y);
}
void link(int x,int y)
{
setroot(x);
fa[x]=y;
}
void cut(int x,int y)
{
spilt(x,y);
c[y][0]=fa[x]=0;
}
int main()
{
cin>>val[1]>>val[2];
sum[1]=val[1];sum[2]=val[2];
link(1,2);
spilt(1,2);
cout<<sum[2]<<endl;
}
求大神们帮帮我吧,唉,真的好难啊,光是这代码我就研究了一个月。。为什么过不了。。。
Leohh @ 2018-05-25 18:11:47
[ Quote ] [ Edit ] [ Delete ] 47#
双旋会被卡啊
应该写单旋2333
falundafa_dot_org @ 2018-05-26 09:12:12
[ Quote ] [ Edit ] [ Delete ] 48#
道理我都懂,但是你怎么可以引战哪
myjs69 @ 2018-05-26 09:12:31
[ Quote ] [ Edit ] [ Delete ] 49#
道理我都懂,但是你splay怎么能单旋啊。
mcfxmcfxmcfx @ 2018-05-26 09:13:37
[ Quote ] [ Edit ] [ Delete ] 50#
道理我都懂,但是你splay就应该单旋啊。
[Top] [Previous Page] [Next Page]

HOME Back