Advertisement
STANAANDREY

sb3 2 bac2020 t19

May 16th, 2022
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. #define NMAX 22
  4. int n, m, k, a[NMAX][NMAX];
  5.  
  6. int main() {
  7.     scanf("%i %i %i", &m, &n, &k);
  8.     for (int i = 1; i <= m; i++) {
  9.         for (int j = 1; j <= n; j++) {
  10.             scanf("%i", &a[i][j]);
  11.         }
  12.     }
  13.     for (int i = 1; i <= m; i++) {
  14.         if (i != k) {
  15.             bool ok = true;
  16.             for (int j = 1; j <= n; j++) {
  17.                 ok &= a[i][j] != a[k][j];
  18.             }
  19.             if (ok) {
  20.                 puts("DA");
  21.                 return 0;
  22.             }
  23.         }
  24.     }
  25.     puts("NU");
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement