結果

問題 No.709 優勝可能性
ユーザー square1001square1001
提出日時 2018-07-02 21:36:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 222 ms / 3,500 ms
コード長 543 bytes
コンパイル時間 707 ms
コンパイル使用メモリ 83,368 KB
実行使用メモリ 10,528 KB
最終ジャッジ日時 2023-09-13 17:02:52
合計ジャッジ時間 3,399 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 41 ms
4,380 KB
testcase_11 AC 18 ms
4,384 KB
testcase_12 AC 85 ms
4,384 KB
testcase_13 AC 93 ms
4,380 KB
testcase_14 AC 78 ms
4,376 KB
testcase_15 AC 81 ms
4,380 KB
testcase_16 AC 131 ms
4,604 KB
testcase_17 AC 222 ms
10,528 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 115 ms
4,376 KB
testcase_21 AC 115 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <map>
#include <vector>
#include <iostream>
using namespace std;
int n, m, x, mx[15]; vector<int> mxlis[15];
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cin >> n >> m;
	map<int, int> d;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j) {
			cin >> x;
			if (mx[j] < x) {
				mx[j] = x;
				for (int k : mxlis[j]) {
					--d[k];
					if (d[k] == 0) d.erase(k);
				}
				mxlis[j].clear();
			}
			if (mx[j] == x) {
				mxlis[j].push_back(i);
				++d[i];
			}
		}
		cout << d.size() << '\n';
	}
	return 0;
}
0