結果
| 問題 |
No.279 木の数え上げ
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-07 16:42:30 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 590 bytes |
| コンパイル時間 | 416 ms |
| コンパイル使用メモリ | 25,472 KB |
| 実行使用メモリ | 8,608 KB |
| 最終ジャッジ日時 | 2025-03-07 16:42:34 |
| 合計ジャッジ時間 | 3,616 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 RE * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%s",p);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
char p[1000];
int count[3] = {0,0,0};
scanf("%s",p);
char *ptr = &p[0];
int i = 0;
while(*(ptr+i) != '\0'){
if(*(ptr+i) == 't'){
count[0]++;
}
if(*(ptr+i) == 'r'){
count[1]++;
}
if(*(ptr+i) == 'e'){
count[2]++;
}
i++;
}
count[2] = count[2]/2;
int max = count[0] , min = count[0];
for(i = 0;i < 3;i++){
if(min > count[i]){
min = count[i];
}
}
printf("%d\n",min);
return 0;
}
Maeda