数据通过了莫名爆零~

P2356 弹珠游戏

@[爱迪生](/space/show?uid=137610) 感谢呀,%%%
by Merci @ 2018-11-09 18:09:07


@[爱迪生](/space/show?uid=137610) 感谢大佬帮助%%%
by Merci @ 2018-11-09 23:00:04


@[sam上帝](/space/show?uid=122822) 不客气~~
by 爱迪生 @ 2018-11-09 23:19:41


```cpp include<iostream> include<cstdio> include<cmath> include<algorithm> include<cstring> using namespace std; char s[5000][5000]; int n; void ak(int x,int y){ int w=0; for(int i=1;i<=n;i++){ w=w+s[i][y]-'0'; } for(int i=1;i<=n;i++){ w=w+s[x][i]-'0'; } return w; } int main(){ cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cin>>s[i][j]; } } int p=0,ans; for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(s[i][j]=='0'){ ans=max(ans,ak(i,j)); p=1; } } } if(p!=0)cout<<ans; else cout<<"Bad Game!"; } ```
by Hola_chen @ 2019-05-01 16:50:31


# 希望更丰富的展现?使用Markdown!
by Hola_chen @ 2019-05-01 16:51:31


没事帮你改排版。。。
by Hola_chen @ 2019-05-01 16:51:57


年轻时的tjj
by mot1ve @ 2020-02-04 15:19:08


上一页 |