結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
pengin_2000
|
| 提出日時 | 2026-10-09 21:33:19 |
| 言語 | C (gcc 15.3.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 569µs | |
| コード長 | 399 bytes |
| 記録 | |
| コンパイル時間 | 416 ms |
| コンパイル使用メモリ | 38,244 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-09 21:33:47 |
| 合計ジャッジ時間 | 2,797 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include<stdio.h>
char s[300005];
int main()
{
int n;
scanf("%d", &n);
int i, j;
scanf("%s", s);
char t[8] = "HAPPY";
int ans = 0, f;
for (i = 0; i < n - 9; i++)
{
f = 0;
for (j = 0; j < 5; j++)
if (s[i + j] != t[j])
f++;
if (f == 0)
{
ans++;
s[i + 4] = '*';
}
}
for (i = n - 5, j = 0; j < 5; j++)
if (s[i + j] != t[j])
ans++;
printf("%d\n", ans);
return 0;
}
pengin_2000