結果

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

ソースコード

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;
	}

	auto max_iterator = std::max_element(A.begin(), A.end());

	std::cout << std::distance(A.begin(), max_iterator) << std::endl;

	return 0;
}
0