結果
| 問題 | 
                            No.8081 HQ9+
                             | 
                    
| コンテスト | |
| ユーザー | 
                             pockyny
                         | 
                    
| 提出日時 | 2021-04-01 21:18:43 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 384 bytes | 
| コンパイル時間 | 479 ms | 
| コンパイル使用メモリ | 66,724 KB | 
| 最終ジャッジ日時 | 2025-01-20 06:25:22 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 4 WA * 5 RE * 12 | 
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main(){
    int i,n; cin >> n;
    string s; cin >> s;
    for(i=0;i<n;i++){
        if(s[i]=='H'){
            exit(1);
            cout << -1 << endl;
            return 0;
        }
    }
    if(s.back()!='Q') cout << -1 << endl;
    else{
        s.pop_back();
        cout << s;
        cout << "Q" << endl;
    }
}
            
            
            
        
            
pockyny