結果
問題 | No.2373 wa, wo, n |
ユーザー |
|
提出日時 | 2023-08-01 23:08:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 673 bytes |
コンパイル時間 | 617 ms |
コンパイル使用メモリ | 72,576 KB |
最終ジャッジ日時 | 2025-02-15 21:24:30 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 WA * 17 |
ソースコード
#include <iostream>#include <vector>using namespace std;#define YES cout << "Yes" << endl#define NO cout << "No" << endlint main(void){int n;string s;cin >> n >> s;int mcnt = 0;string sub1, sub2;for (int i = 0; i < (int)s.size(); i++) {sub1 = s.substr(i, 1);sub2 = s.substr(i, 2);if (sub2 == "w?") {mcnt += 2;i++;}else if (sub2 == "?a" || sub2 == "?o") {mcnt += 2;i++;}else if (sub2 == "wa" || sub2 == "wo") {mcnt += 2;i++;}else if (sub1 == "?" || sub1 == "n") {mcnt++;i++;}}mcnt == (int)s.size() ? YES : NO;}