fork download
  1. /*
  2.  * A. Gain with Pain | SRBD Code Contest - 2024 (Round 1)
  3.  * Author: Sohom Sahaun | @sohomsahaun | CF: sahaun
  4.  */
  5.  
  6. #include <bits/stdc++.h>
  7. using namespace std;
  8.  
  9. #define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
  10. using ll = long long;
  11.  
  12. const int types[] = {2, 2, 2, 1, 3};
  13.  
  14. int main() {
  15. FAST;
  16.  
  17. int tc = 1, ti;
  18. cin >> tc;
  19.  
  20. for (ti = 1; ti <= tc; ++ti) {
  21. int n, i, j;
  22. cin >> n;
  23.  
  24. bool f = 1;
  25. for (i = 0; i < n; ++i) {
  26. vector<int> m(5), q(5), r(5);
  27. for (j = 0; j < 5; ++j) {
  28. cin >> m[j] >> q[j] >> r[j];
  29. if (m[j] != types[j]) f = 0;
  30. if (q[j] != 3) f = 0;
  31. if (r[j] != 10) f = 0;
  32. }
  33. }
  34.  
  35. cout << (f ? "Consistent" : "Inconsistent") << "\n";
  36. }
  37.  
  38. return 0;
  39. }
Success #stdin #stdout 0.01s 5272KB
stdin
1
1
2 3 10
2 3 10
2 3 10
1 3 10
3 3 9
stdout
Inconsistent