EntropyIncreaser

tmp

Sep 8th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <cstring>
  4. #include <ctime>
  5. #include <cmath>
  6.  
  7. #include <algorithm>
  8. #include <iostream>
  9. #include <limits>
  10. #include <numeric>
  11. #include <vector>
  12. #include <queue>
  13. #include <stack>
  14.  
  15. #define LOG(FMT...) fprintf(stderr, FMT)
  16.  
  17. using namespace std;
  18.  
  19. typedef long long ll;
  20.  
  21. const int N = 1010;
  22.  
  23. int n, m;
  24. int a[N][N];
  25. int x[N], y[N];
  26.  
  27.  
  28. int main() {
  29. #ifdef LBT
  30. freopen("test.in", "r", stdin);
  31. int nol_cl = clock();
  32. #endif
  33.  
  34. scanf("%d%d", &n, &m);
  35. for (int i = 1; i <= n; ++i)
  36. for (int j = 1; j <= m; ++j)
  37. scanf("%d", &a[i][j]);
  38. for (int i = 1; i <= n; ++i)
  39. for (int j = 1; j <= m; ++j) {
  40. int x;
  41. scanf("%d", &x);
  42. a[i][j] ^= x;
  43. }
  44. // a[i][j] = x[i] ^ y[j]
  45. for (int j = 1; j <= m; ++j)
  46. y[j] = a[1][j];
  47. for (int i = 2; i <= n; ++i)
  48. x[i] = a[i][1] ^ y[1];
  49. for (int i = 2; i <= n; ++i)
  50. for (int j = 2; j <= m; ++j)
  51. if ((x[i] ^ y[j]) != a[i][j]) {
  52. puts("Budexing");
  53. return 0;
  54. }
  55. puts("Koyi");
  56.  
  57. #ifdef LBT
  58. LOG("%dms\n", (clock() - nol_cl) * 1000 / CLOCKS_PER_SEC);
  59. #endif
  60. return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment