548B. Mike and Fun
生活随笔
收集整理的這篇文章主要介紹了
548B. Mike and Fun
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
B. Mike and Fun:題目
太離譜了呀,這啥遍歷題啊。。。 #include <bits/stdc++.h> using namespace std; #define int long long vector<int> a((int)6e5); vector<int> b((int)6e5), c[(int)6e5]; const int mod = 1e9 + 7; int g[1001][1001]; signed main() {int n,m,q;cin>>n>>m>>q;for (int i=1;i<=n;i++){for (int j=1;j<=m;j++){cin>>g[i][j];}}for (int i=1;i<=n;i++){int cou = 0;for (int j=1;j<=m;j++){if (g[i][j]==1) cou++;else cou = 0;a[i] = max(a[i],cou);}}int x,y;while (q--){cin>>x>>y;g[x][y] = (g[x][y]+1)%2;int cou = 0;a[x] = 0;for (int i=1;i<=m;i++){if (g[x][i]==1) cou++;else cou = 0;a[x] = max(a[x],cou);}int res = 0;for (int i=1;i<=n;i++) res = max(res,a[i]);cout<<res<<endl;} }總結
以上是生活随笔為你收集整理的548B. Mike and Fun的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue导出excel并修改表头样式
- 下一篇: css没有border,你未必知道的CS