为毛偏偏80分

P1031 [NOIP2002 提高组] 均分纸牌

c++党表示看不懂
by XXZ1234 @ 2017-09-17 21:14:20


前排兹茨
by 王子瑜 @ 2017-10-17 18:57:14


a[n]为0就会错 var ....... l,r:longint; ....... ```cpp l:=1; r:=n; while a[l]=m do inc(l); while a[r]=m do dec(r); for i:=l to r-1 do begin if a[i]<10 then begin a[i+1]:=a[i+1]-(m-a[i]); a[i]:=m;end; if a[i]>10 then begin a[i+1]:=a[i]-m+a[i+1]; a[i]:=m;end; s:=s+1; end; ```
by XeCtera @ 2017-10-24 20:44:52


抱歉 while循环的判断条件分别加上(l<n)和(r>1)
by XeCtera @ 2017-10-24 21:03:18


C++ player can't read. # ... ## ... ### ... #### ... ##### ... ###### ...
by 海滨WA声 @ 2018-02-01 09:28:59


|