結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 21:23:49 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 6 ms / 2,000 ms |
| + 570µs | |
| コード長 | 511 bytes |
| 記録 | |
| コンパイル時間 | 1,867 ms |
| コンパイル使用メモリ | 337,324 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-09 21:24:04 |
| 合計ジャッジ時間 | 4,076 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n;
string s;
cin >> n >> s;
string h = "HAPPY";
int ans = 0;
rep(i, n - 9) {
if (s.substr(i, 5) == h) {
ans++;
}
}
auto t = s.substr(n - 5, 5);
rep(i, 5) {
if (t[i] != h[i])
ans++;
}
cout << ans << endl;
return 0;
}