結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
ei1333333
|
| 提出日時 | 2026-09-10 02:27:34 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 7 ms / 2,000 ms |
| + 352µs | |
| コード長 | 340 bytes |
| 記録 | |
| コンパイル時間 | 3,226 ms |
| コンパイル使用メモリ | 354,268 KB |
| 実行使用メモリ | 9,900 KB |
| 最終ジャッジ日時 | 2026-10-09 20:50:14 |
| 合計ジャッジ時間 | 4,734 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
constexpr string T = "HAPPY";
int main() {
int N;
cin >> N;
string S;
cin >> S;
int ret = 0;
for (int i = 0; i < 5; i++) {
ret += S[N - 5 + i] != T[i];
}
for (int i = 0; i + 5 <= N - 5; i++) {
if (S.substr(i, 5) == T) {
ret++;
}
}
cout << ret << endl;
}
ei1333333