結果
問題 | No.279 木の数え上げ |
ユーザー |
|
提出日時 | 2016-11-17 23:34:01 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 345 bytes |
コンパイル時間 | 124 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 03:27:58 |
合計ジャッジ時間 | 1,041 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s",s); | ^~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> int main(void){ int t=0,r=0,e=0,i,l; char s[1048576]; scanf("%s",s); l = strlen(s); for(i = 0;i < l;i++){ if(s[i] == 't'){t++;} if(s[i] == 'r'){r++;} if(s[i] == 'e'){e++;} } e/=2; if(t <= r && t <= e){printf("%d\n",t);} else if(r <= e){printf("%d\n",r);} else{printf("%d\n",e);} return 0; }