結果
問題 |
No.279 木の数え上げ
|
ユーザー |
![]() |
提出日時 | 2015-09-18 22:26:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 352 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 34,688 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 06:59:06 |
合計ジャッジ時間 | 3,255 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 RE * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | char s[100001];scanf("%s",s); | ~~~~~^~~~~~~~
ソースコード
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; //namaega184 int main(){ char s[100001];scanf("%s",s); int tree[4]={}; int len=strlen(s); for(int i=0;i<len;i++){ if(s[i]=='t')tree[0]++; else if(s[i]=='r')tree[1]++; else if(s[i]=='e')tree[2]++; } printf("%d\n",min({tree[0],tree[1],tree[2]/2})); return 0; }