fork download
  1. /*
  2.   shool : Cu Chi High School
  3.   participant : Ngo Quoc Binh
  4. */
  5. #include <bits/stdc++.h>
  6. using namespace std;
  7.  
  8. #define debug(x) cerr << #x << " = " << x << "\n";
  9. #define vdebug(a) cerr << #a << " = "; for(auto x : a) cout << x << " "; cout << "\n";
  10. #define TIME cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
  11. #define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  12. #define hashmap unordered_map
  13. #define hashset unordered_set
  14. #define all(x) (x).begin(),(x).end()
  15. #define rall(x) (x).rbegin(),(x).rend()
  16. #define rev(x) reverse(all(x))
  17. #define sz(x) ((int)((x).size()))
  18. #define max_arr(x) *max_element(all(x))
  19. #define min_arr(x) *min_element(all(x))
  20.  
  21. #define pb push_back
  22. #define pf push_front
  23. #define PB pop_back
  24. #define PF pop_front
  25. #define en '\n'
  26. #define ff first
  27. #define ss second
  28. #define task "wtf"
  29.  
  30. using ll = long long;
  31. using ull = unsigned long long;
  32. using ld = long double;
  33.  
  34. mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
  35.  
  36. void solve()
  37. {
  38. int n,m,d;
  39. cin >> n >> m >> d;
  40.  
  41. set<vector<int>> a;
  42. for(int i = 0 ; i < n ; i++)
  43. {
  44. vector<int> res(d + 1);
  45. for(int j = 0 ; j <= d ; j++) cin >> res[j];
  46. a.insert(res);
  47. }
  48.  
  49. for(int i = 0 ; i < m ; i++)
  50. {
  51. vector<int> res(d + 1);
  52. for(int j = 0 ; j <= d ; j++) cin >> res[j];
  53. if(a.count(res)) cout << "BAD" << en;
  54. else cout << "GOOD" << en;
  55. }
  56. }
  57.  
  58. int main()
  59. {
  60. fastIO
  61.  
  62. solve();
  63.  
  64. return 0;
  65. }
Success #stdin #stdout 0s 5316KB
stdin
2 3 4
1 2 3 4 5
6 7 8 9 0
1 2 3 4 5
6 7 8 9 0
9 0 1 2 3
stdout
BAD
BAD
GOOD