結果
問題 | No.279 木の数え上げ |
ユーザー | どらら |
提出日時 | 2015-09-18 22:23:17 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 839 bytes |
コンパイル時間 | 805 ms |
コンパイル使用メモリ | 89,884 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 15:06:48 |
合計ジャッジ時間 | 1,838 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <iostream> #include <queue> #include <list> #include <stack> #include <map> #include <numeric> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; int main(){ string S; cin >> S; map<char,int> memo; rep(i,S.length()){ memo[S[i]]++; } int ret = 0; while(true){ if(memo['t']>0 && memo['r']>0 && memo['e']>1){ ret++; memo['t']--; memo['r']--; memo['e']-=2; }else{ break; } } cout << ret << endl; return 0; }