Advertisement
leminhkt

noname29

Mar 18th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #define ll long long
  3. #define ld long double
  4. #define lFOR(i, a, b) for(ll i=(a); i<=(b); i++)
  5. #define lFORn(i, n) for(ll i=1; i<=(n); i++)
  6. #define lFORx(i, a, b, n) for(ll i=(a); i<=(b); i+=(x))
  7. #define FORa(i, b) for(i; i<=(b); i++)
  8. #define FORax(i, b, x) for(i; i<=(b); i+=(x))
  9. #define lFORR(i, a, b) for(ll i=(a); i>=(b); i--)
  10. #define lFORRn(i, n) for(ll i=(n); i>=1; i--)
  11. #define lFORRx(i, a, b, n) for(ll i=(a); i>=(b); i-=(x))
  12. #define FORRa(i, b) for(i; i>=(b); i--)
  13. #define FORRax(i, b, x) for(i; i>=(b); i-=(x))
  14. #define iFOR(i, a, b) for(int i=(a); i<=(b); i++)
  15. #define iFORn(i, n) for(int i=1; i<=(n); i++)
  16. #define iFORx(i, a, b, n) for(int i=(a); i<=(b); i+=(x))
  17. #define iFORR(i, a, b) for(int i=(a); i>=(b); i--)
  18. #define iFORRn(i, n) for(int i=(n); i>=1; i--)
  19. #define iFORRx(i, a, b, n) for(int i=(a); i>=(b); i-=(x))
  20. #define pb(x) push_back(x)
  21. #define all(x) (x).begin(), (x).end()
  22. #define sz(x) (x).size()
  23. #define sqr(x) (ll)(x)*(x)
  24. #define PI (2*acos(0))
  25. using namespace std;
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.         //=================declare=================
  33.     int res, N, K, P;
  34.     int a[256];
  35.  
  36.  
  37.  
  38.  
  39. //=================..end..=================
  40.         //=================function=================
  41.  
  42.  
  43.  
  44.  
  45.  
  46. //=================..end...=================
  47. int main(){
  48.     //freopen("INPUT.inp", "r", stdin);
  49.     //freopen("OUTPUT.out", "w", stdout);
  50.     //ios_base::sync_with_stdio(0); cin.tie(0);
  51.         //=================code=================
  52.     cin>>N>>K>>P;
  53.     cout<<(a[1]=rand()%100+1);
  54.     iFOR(i, 2, N){
  55.         cout<<' '<<(a[i]=rand()%100+1);
  56.         res+=(abs(a[i]-a[i-1])>=P);
  57.     }
  58.     if(res>=K) cout<<"\nYES";
  59.     else cout<<"\nNO";
  60.  
  61.  
  62.  
  63.  
  64. //=================end.=================
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement