結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー AQUA16573837AQUA16573837
提出日時 2018-03-13 01:39:39
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 455 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 39,884 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 18:25:43
合計ジャッジ時間 1,218 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 12 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 11 ms
6,944 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 8 ms
6,948 KB
testcase_15 AC 3 ms
6,940 KB
testcase_16 AC 9 ms
6,944 KB
testcase_17 AC 3 ms
6,940 KB
testcase_18 AC 9 ms
6,944 KB
testcase_19 AC 7 ms
6,944 KB
testcase_20 AC 12 ms
6,944 KB
testcase_21 AC 1 ms
6,944 KB
testcase_22 AC 5 ms
6,940 KB
testcase_23 AC 12 ms
6,940 KB
testcase_24 AC 12 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%d", L + i);
      |                 ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;

//79
int main() {
	int n, L[100000];
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d", L + i);
	sort(L, L + n);

	int carry = 1, mcarry = 0, res = 0;
	for (int i = 1; i < n; i++) {
		if (L[i] != L[i - 1]) {
			carry = 1;
		} else {
			carry++;
		}
		mcarry = max(mcarry, carry);
		if (mcarry == carry)
			res = L[i];
	}
	printf("%d\n", res);
}
0