fork download
  1. #include <bits/stdc++.h>
  2.  
  3. #define int long long
  4. #define MOD 1000000007
  5.  
  6. using namespace std;
  7.  
  8. void solve() {
  9. int a[10000000000];
  10. for(int i = 0; i < 1e10; i++) {
  11. a[i] = i;
  12. a[i]++;
  13. }
  14. string s;
  15. cin >> s;
  16. sort(s.begin(),s.end());
  17. if(s == "CMP") {
  18. cout << "YES" << endl;
  19. }
  20. else cout << "NO" << endl;
  21. }
  22.  
  23.  
  24. int32_t main() {
  25. int t = 1;
  26. cin >> t;
  27. while(t--) {
  28. solve();
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0s 5044KB
stdin
3
PCM
CCP
CPM
stdout
YES
NO
YES