結果
| 問題 | No.3757 Happy End |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-17 10:31:54 |
| 言語 | C (gcc 15.3.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 438 bytes |
| 記録 | |
| コンパイル時間 | 841 ms |
| コンパイル使用メモリ | 37,700 KB |
| 実行使用メモリ | 9,924 KB |
| 最終ジャッジ日時 | 2026-10-17 10:31:59 |
| 合計ジャッジ時間 | 3,357 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 27 WA * 20 |
ソースコード
#include "stdio.h"
#include "string.h"
char s[300000+100];
char h[]="HAPPY";
int main(void){
int n;
scanf("%d",&n);
scanf("%s",s);
int count=0;
for(int i=0;i<n;i++){
char t=s[i+5];
s[i+5]='\0';
if(strcmp(&s[i],h)==true){
count++;
}
s[i+5]=t;
}
if(strcmp(&s[n-5],h)==true){
printf("%d\n",count-1);
return 0;
}else{
for(int i=0;i<5;i++){
if(s[n-5+i]!=h[i])count++;
}
printf("%d\n",count);
}
return 0;
}