結果

問題 No.3081 HQ9+
ユーザー pockynypockyny
提出日時 2021-04-01 21:18:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 68,384 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-23 05:24:49
合計ジャッジ時間 1,576 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    }
}
0