Solutions/Dlbo's Solution
PKU 2260. Error Correction. AC get -_-
알 수 없는 사용자
2010. 10. 28. 11:02
#includeusing namespace std; int main() { int n, horsum, versum, horcnt, vercnt, i, j, x[100][100], cx, cy; while (cin >> n) { horcnt = 0; vercnt = 0; if (!n) { break; } for (i = 0; i < n; i++) { horsum = 0; for (j = 0; j < n; j++) { cin >> x[i][j]; horsum = x[i][j] + horsum; } if (horsum % 2 != 0) { cx = i; horcnt++; } } if (horcnt >= 2) { cout << "Corrupt" << endl; continue; } for (j = 0; j < n; j++) { versum = 0; for (i = 0; i < n; i++) { versum = versum + x[i][j]; } if (versum % 2 != 0) { cy = j; vercnt++; } } if (vercnt >= 2) { cout << "Corrupt" << endl; continue; } if (horcnt == 0 && vercnt == 0) { cout << "OK" << endl; } else { cout << "Change bit (" << cx + 1 << "," << cy + 1 << ")" << endl; } } return 0; }
이게 바로 무컴파일 AC -_-