結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 21:29:14 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 423 bytes |
| 記録 | |
| コンパイル時間 | 1,906 ms |
| コンパイル使用メモリ | 336,764 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-09 21:29:36 |
| 合計ジャッジ時間 | 4,152 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 12 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
int n;
string s;
cin >> n >> s;
string p = "HAPPY";
int ans = 0;
rep(i, n-5) {
if (s.substr(i, 5) == p) {
s[i+2] = '#';
++ans;
}
}
rep(i, 5) {
if (s[n-5+i] != p[i]) ++ans;
}
cout << ans << '\n';
return 0;
}