poj2260
来源:互联网 发布:狗粮 饼干 淘宝 编辑:程序博客网 时间:2024/06/05 13:27
1 题目
水题
2 分析
3
#include <iostream>#include <string.h>#include <algorithm>#include <stdio.h>using namespace std;int mat[110][110];int row[110];int col[110];int main(){ int n; while(~scanf("%d",&n)&&n!=0){ ///ini+function1 memset(row,0,sizeof(row)); memset(col,0,sizeof(col)); for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ scanf("%d",&mat[i][j]); if(mat[i][j]){ row[i]++; col[j]++; } } } ///function2 int bj=0; int temp_x=0,temp_y=0; for(int i=1;i<=n;i++){ if(row[i]&1){ bj++; temp_x=i; //cout<<"row_bj: "<<bj<<" "<<temp_x<<endl; } if(col[i]&1){ bj++; temp_y=i; //cout<<"col_bj: "<<bj<<" "<<temp_y<<endl; } } if(bj==0){ cout<<"OK"<<endl; continue; } else if(bj==2&&temp_x!=0&&temp_y!=0){ printf("Change bit (%d,%d)\n",temp_x,temp_y); } else{ cout<<"Corrupt"<<endl; } } return 0;}
0 0
- poj2260
- poj2260
- poj2260
- POJ2260:Error Correction
- POJ2260 Error Correction
- Eclipse快捷键
- spark机器学习-聚类
- 内心深处的震撼,科研道路上的拙见,命运不甘平凡的抗争
- <四> 无显示器的情况下远程登录树莓派
- 半成品技术博客开张了
- poj2260
- 应用布尔盲注来爆库(1)
- python flask+uwsgi+tengine 容器
- Linux下的部分正则表达式
- 如何利用C++ vector的sort算法对元素是自定义类型进行排序
- 第十一周项目1——二叉树算法验证(2)二叉树构造算法验证
- [Javascript] 处理浮点数相乘误差方法
- HashSet、LinkedHashSet、TreeSet+JAVA学习笔记-DAY17
- android下json解析