結果
| 問題 |
No.2240 WAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-10 21:25:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 974 bytes |
| コンパイル時間 | 1,001 ms |
| コンパイル使用メモリ | 111,612 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-18 03:34:57 |
| 合計ジャッジ時間 | 1,985 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 43 |
ソースコード
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"
using namespace std;
//constexpr long long int MOD = 1000000007;
constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;
//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> N >> M;
string s;
cin >> s;
int w = 0;
int c = 0;
int a = 0;
for (auto i : s) {
if (i == 'W') {
w++;
}
else if (i == 'C') {
c++;
if (c > a) {
cout << "No" << endl;
return 0;
}
}
else {
a++;
if (a - M > w) {
cout << "No" << endl;
return 0;
}
}
}
cout << "Yes" << endl;
}