結果
問題 | No.279 木の数え上げ |
ユーザー |
|
提出日時 | 2018-07-28 13:51:19 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 619 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 55,288 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 18:24:09 |
合計ジャッジ時間 | 1,538 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
//No.279 木の数え上げ#include<iostream>#include<string>using namespace std;int main(){string S;cin>>S;int cnt_tre[3]={0,0,0};for(int i=0;i<S.length();i++){switch(S[i]){case 't':cnt_tre[0]++;break;case 'r':cnt_tre[1]++;break;case 'e':cnt_tre[2]++;break;}}cnt_tre[2]/=2;int cnt_min=cnt_tre[0];for(int i=1;i<3;i++){if(cnt_min>cnt_tre[i])cnt_min=cnt_tre[i];}cout<<cnt_min<<endl;return 0;}