|
刷榜是可耻的行为,更何况是别人的代码。。。。某些人有点过分啊
|
|
我想知道这题正解什么鬼!为什么各种BUG都能过,但是有的T,有的不T!卡SPFA是什么鬼!
题目 2093 花园的守护之神
2016-04-15 11:17:40
|
|
.为啥会过。。。
|
|
(⊙o⊙)
页面 66 删号公告
2016-04-15 11:10:24
|
|
[size=50]哈哈哈[/size]
页面 66 删号公告
2016-04-15 11:07:29
|
|
|
|
强烈建议管理员想办法把不写main函数的刷榜方法卡掉。。。
|
|
数组开小了.................
|
|
|
|
快传数据....
题目 2067 [BZOJ 3674] 可持久化并查集加强版
2016-04-15 09:32:54
|
|
暴力卡过.
|
|
题目 28 [NOI 2006]最大获利
2016-04-15 09:11:02
|
|
回复 @3517 :
题目 2213 K个串
2016-04-15 06:19:55
|
|
题目 2213 K个串
2016-04-15 06:17:46
|
|
#include <fstream>
using namespace std; ifstream cin("shorta.in"); ofstream cout("shorta.out"); int main() { int e[501][501],i,j,k,s,a,t1,t2,t3,n,m,inf=999999; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(i==j) e[i][j]=0; else e[i][j]=inf; for(i=1;i<=m;i++) { cin>>t1>>t2>>t3; e[t1][t2]=t3; e[t2][t1]=t3; } for(k=1;k<=n;k++) for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(e[i][j]>e[i][k]+e[k][j]) e[i][j]=e[i][k]+e[k][j]; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) cout<<e[i][j]<<" "; cout<<endl; } cin.close();cout .close(); return 0; }#include <fstream> using namespace std; ifstream cin("shorta.in"); ofstream cout("shorta.out"); int main() { int e[501][501],i,j,k,s,a,t1,t2,t3,n,m,inf=999999; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(i==j) e[i][j]=0; else e[i][j]=inf; for(i=1;i<=m;i++) { cin>>t1>>t2>>t3; e[t1][t2]=t3; e[t2][t1]=t3; } for(k=1;k<=n;k++) for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(e[i][j]>e[i][k]+e[k][j]) e[i][j]=e[i][k]+e[k][j]; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) cout<<e[i][j]<<" "; cout<<endl; } cin.close();cout .close(); return 0; }
题目 1 加法问题
2016-04-14 20:53:28
|
|
@menci 数据似乎有误,后两组数据路程好像不到n条吧...
|
|
尝试c++抢榜失败
题目 2061 连续出现的字符
2016-04-14 20:37:56
|
|
VIP 新技能浮水法,好棒~
题目 834 [USACO 3.1]形成的区域 Shaping Regions
2016-04-14 20:23:43
|
|
哈哈哈
页面 66 删号公告
2016-04-14 20:10:44
|
|
求找错。。。。。
program www; const maxn=1000000; var heap,c,d,di:array[0..maxn]of longint; len,i,n,tmp,p,sum,j,px,tot,fur,wu,k,i1:longint; procedure put(x:longint); var fa,son,tmp:longint; begin inc(len); heap[len]:=x; son:=len; while(son<>1)and(heap[son div 2]>heap[son])do begin tmp:=heap[son div 2]; heap[son div 2]:=heap[son]; heap[son]:=tmp; son:=son div 2; end; end; function get:longint; var fa,son,tmp:longint; begin get:=heap[1]; heap[1]:=heap[len]; len:=len-1; fa:=1; while(fa*2<=len)or(fa*2+1<=len)do begin if (fa*2+1>len)and(heap[fa*2]<heap[fa*2+1]) then son:=fa*2 else son:=fa*2+1; if heap[fa]>heap[son] then begin tmp:=heap[fa]; heap[fa]:=heap[son]; heap[son]:=tmp; fa:=son; end else break; end; end; procedure kong; var i:longint; begin for i:=1 to maxn do heap[i]:=0; end; begin assign(input,'pal.in');reset(input); assign(output,'pal.out');rewrite(output); readln(p); readln(n);tot:=0;sum:=0; for i:=1 to n do readln(c[i],d[i]); c[n+1]:=-1; di[0]:=0; for i:=1 to n do di[i]:=di[i-1]+d[i]; d[n+1]:=maxlongint; i:=1;i1:=0; while tot<di[n] do begin put(c[i]); fur:=p; for j:=i to n+2 do begin if fur>0 then begin fur:=fur-d[j]; if j<>i then put(c[j]); end else break; end; wu:=get; if wu<>-1 then begin wu:=get; for k:=i to n do if c[k]=wu then break; sum:=sum+(di[k-1]-di[i-1])*c[i]; tot:=di[k-1]; i:=k; kong; end else begin wu:=get; if wu<>0 then begin for k:=i to n do if c[k]=wu then break; sum:=sum+(di[k-1]-di[i-1])*c[i]; tot:=di[k-1]; i:=k; sum:=sum+(di[n]-di[i-1])*c[i]; tot:=di[n]; end else begin sum:=sum+(di[n]-di[i-1])*c[i]; tot:=di[n]; end; end; end; writeln(sum); close(input); close(output); end.
题目 241 [POI 1997] 汽油花费
2016-04-14 20:09:02
|