結果
問題 |
No.279 木の数え上げ
|
ユーザー |
![]() |
提出日時 | 2015-11-05 21:32:58 |
言語 | C90 (gcc 12.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 313 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 21,248 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-13 12:50:38 |
合計ジャッジ時間 | 2,726 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 RE * 11 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s",c); | ^~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int main(void){ int i,b=25000; int a[3] = {}; char c[100000]; scanf("%s",c); for(i=0;i<strlen(c);i++){ if(c[i] == 't') a[0]++; if(c[i] == 'r') a[1]++; if(c[i] == 'e') a[2]++; } a[2] /=2; for(i=0;i<3;i++){ if(b>a[i]) b=a[i]; } printf("%d\n",b); return 0; }