fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int arr[101];
  5. int main() {
  6. long long x, c;
  7. cin >> x;
  8. int n, i = 0;
  9. cin >> n;
  10. while (cin >> c) {
  11. if (c == x) {
  12. arr[i % n]++;
  13. }
  14. i++;
  15. }
  16. for (int i = 0; i < n; i++) {
  17. if (arr[i] > 0) {
  18. cout << "YES" << endl;
  19. }
  20. else {
  21. cout << "NO" << endl;
  22. }
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 15232KB
stdin
13
3
13 33 75
23 45 31
13 13 13
stdout
YES
YES
YES