T3000

Untitled

Jan 20th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5.  
  6. int main()
  7. {
  8.     ll t1, t2, ts, a;
  9.     vector<long long> z1;
  10.     cin >> t1 >> t2;
  11.     ts = t2;
  12.  
  13.     while (t2-- > 0)
  14.     {
  15.         cin >> a;
  16.         z1.push_back(a);
  17.     }
  18.     ll n = 1, x, z = 0;
  19.     while (n <= t1)
  20.     {
  21.         for (int i = 0; i < ts; i++)
  22.         {
  23.             if (n != z1.at(i))
  24.             {
  25.                 z += 1;
  26.             }
  27.  
  28.             if (z == ts)
  29.             {
  30.                 cout << n << '\n';
  31.                 return 0;
  32.             }
  33.         }
  34.         z = 0;
  35.         n += 1;
  36.     }
  37.     cout << "too late" << '\n';
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment