結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 22:19:21 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 61µs | |
| コード長 | 429 bytes |
| 記録 | |
| コンパイル時間 | 1,837 ms |
| コンパイル使用メモリ | 336,964 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-09 22:19:26 |
| 合計ジャッジ時間 | 4,392 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n, ans = 0;
string s, t = "HAPPY";
cin >> n >> s;
while(!t.empty()){
ans += s.back() != t.back();
s.pop_back();
t.pop_back();
}
for(int i = 0; i + 5 <= (int)s.size(); i++){
ans += s.substr(i, 5) == "HAPPY";
}
cout << ans << '\n';
}