結果

問題 No.706 多眼生物の調査
ユーザー dgd1724dgd1724
提出日時 2018-07-22 22:36:17
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 571 bytes
コンパイル時間 1,090 ms
コンパイル使用メモリ 66,844 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-27 01:01:13
合計ジャッジ時間 1,465 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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