結果
問題 |
No.279 木の数え上げ
|
ユーザー |
|
提出日時 | 2019-02-18 13:34:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 375 ms |
コンパイル使用メモリ | 55,568 KB |
実行使用メモリ | 5,300 KB |
最終ジャッジ日時 | 2024-10-05 20:44:46 |
合計ジャッジ時間 | 1,400 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { int a=0, b=0, c=0, d=0; string str; cin >> str; for (int i = 0; i < str.length(); i++) { if (str[i] == 't') a++; if (str[i] == 'r') b++; if (str[i] == 'e') c++; if (a >= 1 && b >= 1 && c >= 2) { d++; a--; b--; c -= 2; } } cout << d << endl; return 0; }