結果
| 問題 |
No.279 木の数え上げ
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-09-18 22:27:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 353 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 34,816 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-14 15:07:45 |
| 合計ジャッジ時間 | 980 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | char s[1000001];scanf("%s",s);
| ~~~~~^~~~~~~~
ソースコード
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
//namaega184
int main(){
char s[1000001];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;
}
184