|
|
вернуться в форумwhy am i getting WA in test 12 #include <stdio.h> #include <iostream> using namespace std; int n, m, segRez[3004]; int segm1[3004]; char segm2[6005]; int main() { cin >> n >> m; for(int i = 0; i < n; ++i){ gets_s(segm2); for(int j = 0; j < m; ++j){ segRez[j] = segm1[j] + int(segm2[j<<1] - 48); segm1[j] = int(segm2[j<<1] - 48); if(j - 1 >= 0 && ((segRez[j - 1]|segRez[j])) == 3){ cout << "No"; return 0; } } } cout << "Yes"; } |
|
|