結果
| 問題 | No.279 木の数え上げ |
| コンテスト | |
| ユーザー |
Eclair1015
|
| 提出日時 | 2018-07-10 15:49:23 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 583 ms |
| コンパイル使用メモリ | 79,420 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-03 08:56:04 |
| 合計ジャッジ時間 | 1,680 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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