結果

問題 No.706 多眼生物の調査
ユーザー focusfocus
提出日時 2018-07-10 21:33:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 65,472 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 20:35:43
合計ジャッジ時間 1,231 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
	int n,sum[1002]={0},num=0,ans=0;
	string str;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> str;
		int cnt = 0;
		for(int j=0;j<str.size();j++){
			if(str[j]=='^')	cnt++;
		}
		sum[cnt]++;
	}
	for(int i=0;i<=1000;i++){
		if(sum[i]>=num){
				ans = i;
				num = sum[i];
		}
	}
	cout << ans << endl;
}
0