結果
問題 | No.8081 HQ9+ |
ユーザー |
![]() |
提出日時 | 2021-04-01 21:17:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 363 bytes |
コンパイル時間 | 615 ms |
コンパイル使用メモリ | 66,812 KB |
最終ジャッジ日時 | 2025-01-20 06:25:14 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 WA * 5 |
ソースコード
#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'){ cout << -1 << endl; return 0; } } if(s.back()!='Q') cout << -1 << endl; else{ s.pop_back(); cout << s; cout << "Q" << endl; } }