結果

問題 No.706 多眼生物の調査
ユーザー dgd1724
提出日時 2018-07-22 23:02:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 66,320 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 05:26:18
合計ジャッジ時間 1,196 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

int main() {

	//std::ifstream inf("Text.txt");	std::cin.rdbuf(inf.rdbuf());

	int N;
	std::cin >> N;

	int cont = 0;
	std::vector<int> A(1001, 0);
	std::string S;
	for (int i = 0; i < N; i++) {
		std::cin >> S;
		for (unsigned int j = 1; j < S.length(); j++) {
			if (S[j] == '^') {
				cont++;
			}
		}
		A[cont]++;
		cont = 0;
	}

	int max = *std::max_element(A.begin(), A.end());
	auto r_itr = std::find(A.rbegin(), A.rend(), max);

	int temp = std::distance(A.begin(), r_itr.base());

	std::cout << temp - 1 << std::endl;

	return 0;
}
0