版本比较
题解:P13173 [GCJ 2017 #2] Beaming With Joy
正文
增加 5 行删除 5 行
116 行未改动全部展开1171181191201211211221231241251251261271281293 行未改动13313413513613713713813914014119 行未改动16116216316416516516616716816913 行未改动18318418518618718718818919019120 行未改动116 行未改动全部展开 memset(scc,0,sizeof scc); memset(st,0,sizeof st); memset(ins,0,sizeof ins); tot=num=top=cnt=0;
scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf("%s",mp[i]+1);
cout<<"Case #"<<T<<": "; for(int i=1;i<=n;i++) for(int j=1;j<=m;j++){ cover[i][j][0]=cover[i][j][1]={0,0,0};3 行未改动 } } for(int i=1;i<=tot*2;i++) edge[i].clear(); // 读入和初始化。
bool k=1; for(int i=1;i<=tot && k;i++){ pii p=pt[i]; int x=p.first, y=p.second;19 行未改动 if(!k){ cout<<"IMPOSSIBLE\n"; continue; }
for(int i=1;i<=n && k;i++){ for(int j=1;j<=m && k;j++){ if(mp[i][j]!='.') continue; // 遍历每一个空地。13 行未改动 if(!k){ cout<<"IMPOSSIBLE\n"; continue; }
for(int i=1;i<=tot*2;i++) if(!dfn[i]) tarjan(i); k=1; for(int i=1;i<=tot && k;i++)20 行未改动