結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 22:18:02 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 1,889 ms |
| コンパイル使用メモリ | 337,100 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-09 22:18:11 |
| 合計ジャッジ時間 | 4,407 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 10 WA * 37 |
ソースコード
#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";
reverse(t.begin(), t.end());
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';
}