結果

問題 No.2240 WAC
ユーザー umezoumezo
提出日時 2023-03-10 22:26:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 731 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 208,392 KB
実行使用メモリ 5,048 KB
最終ジャッジ日時 2023-10-18 08:08:32
合計ジャッジ時間 4,211 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 RE -
testcase_09 WA -
testcase_10 AC 21 ms
4,780 KB
testcase_11 AC 21 ms
4,916 KB
testcase_12 AC 11 ms
5,048 KB
testcase_13 AC 6 ms
4,348 KB
testcase_14 AC 4 ms
4,348 KB
testcase_15 AC 9 ms
4,776 KB
testcase_16 WA -
testcase_17 AC 9 ms
4,348 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 11 ms
4,776 KB
testcase_21 WA -
testcase_22 AC 8 ms
4,348 KB
testcase_23 AC 5 ms
4,348 KB
testcase_24 AC 9 ms
4,348 KB
testcase_25 WA -
testcase_26 AC 5 ms
4,348 KB
testcase_27 AC 4 ms
4,348 KB
testcase_28 AC 5 ms
4,348 KB
testcase_29 AC 3 ms
4,348 KB
testcase_30 AC 7 ms
4,348 KB
testcase_31 AC 12 ms
4,776 KB
testcase_32 WA -
testcase_33 AC 8 ms
4,348 KB
testcase_34 AC 9 ms
4,348 KB
testcase_35 AC 3 ms
4,348 KB
testcase_36 WA -
testcase_37 AC 11 ms
4,776 KB
testcase_38 AC 6 ms
4,348 KB
testcase_39 AC 13 ms
4,776 KB
testcase_40 AC 7 ms
4,348 KB
testcase_41 AC 8 ms
4,348 KB
testcase_42 AC 7 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int n,m;
  string s;
  cin>>n>>m>>s;
  priority_queue<int> qa,qc;
  priority_queue<int, vector<int>, greater<int> > qw;
  rep(i,n+m){
    if(s[i]=='W') qw.push(i);
    else if(s[i]=='A') qa.push(i);
    else qc.push(i);
  }
  while(qw.size()){
    if(qa.top()<qw.top()){
      cout<<"No"<<endl;
      return 0;
    }
    qa.pop();
    qw.pop();
  }
  while(qc.size()){
    if(qa.top()>qc.top()){
      cout<<"No"<<endl;
      return 0;
    }
    qa.pop();
    qc.pop();
  }
  cout<<"Yes"<<endl;
  
  return 0;
}
0