結果
| 問題 | No.279 木の数え上げ |
| コンテスト | |
| ユーザー |
Eclair1015
|
| 提出日時 | 2018-07-10 15:49:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 452 ms |
| コンパイル使用メモリ | 62,548 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 11:44:23 |
| 合計ジャッジ時間 | 1,482 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include<string>
using namespace std;
int main(){
string s;
cin >> s;
vector<int> a(3);
for (int i = 0; i < s.size(); i++) {
if (s[i] == 't') {
a[0]++;
}else if (s[i] == 'r') {
a[1]++;
}else if(s[i]=='e'){
a[2]++;
}
}
a[2] /= 2;
vector<int>::iterator itr = min_element(a.begin(), a.end());
int minIndex = distance(a.begin(), itr);
cout << a[minIndex] << endl;
return 0;
}
Eclair1015