Advertisement
Saleh127

CF 765B

Nov 2nd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);
  9. cout.tie(0);
  10.  
  11.  
  12. string a;
  13. cin>>a;
  14. char c='a';
  15. ll i;
  16.  
  17. for(i=0; i<a.size(); i++)
  18. {
  19. if(a[i]>c)
  20. {
  21. cout<<"NO"<<endl;
  22. return 0;
  23. }
  24. if(a[i]==c)
  25. {
  26. c++;
  27. }
  28. }
  29.  
  30. cout<<"YES"<<endl;
  31.  
  32. return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement