結果
問題 |
No.279 木の数え上げ
|
ユーザー |
|
提出日時 | 2020-05-24 12:25:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 361 bytes |
コンパイル時間 | 1,523 ms |
コンパイル使用メモリ | 168,212 KB |
実行使用メモリ | 5,424 KB |
最終ジャッジ日時 | 2024-10-11 03:47:32 |
合計ジャッジ時間 | 2,606 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ string s; cin>>s; int t,r,e; t=r=e=0; rep(i,s.size()){ if(s[i]=='t') t++; if(s[i]=='r') r++; if(s[i]=='e') e++; } int ans=0; while(1){ t-=1; r-=1; e-=2; if(t<0||r<0||e<0) break; else ans++; } cout << ans << endl; }