Advertisement
Plabon_dutta

UVA 12036

Nov 20th, 2021
1,052
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3.     int t, n, x, Case = 0;
  4.     scanf("%d", &t);
  5.     while(t--) {
  6.         scanf("%d", &n);
  7.         int count[101] = {};
  8.         int i, j, flag = 1;
  9.         for(i = 0; i < n; i++) {
  10.             for(j = 0; j < n; j++) {
  11.                 scanf("%d", &x);
  12.                 count[x]++;
  13.                 if(count[x] > n)
  14.                     flag = 0;
  15.             }
  16.         }
  17.         printf("Case %d: ", ++Case);
  18.         if(flag == 1)   puts("yes");
  19.         else            puts("no");
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement