結果

問題 No.709 優勝可能性
ユーザー square1001square1001
提出日時 2018-07-02 21:38:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 116 ms / 3,500 ms
コード長 542 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 69,360 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2023-09-13 17:03:06
合計ジャッジ時間 3,066 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 42 ms
4,376 KB
testcase_11 AC 19 ms
4,376 KB
testcase_12 AC 85 ms
4,380 KB
testcase_13 AC 87 ms
4,376 KB
testcase_14 AC 77 ms
4,376 KB
testcase_15 AC 71 ms
4,376 KB
testcase_16 AC 72 ms
4,380 KB
testcase_17 AC 72 ms
6,400 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 116 ms
4,376 KB
testcase_21 AC 115 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <iostream>
using namespace std;
int n, m, x, ret, mx[15], d[100009]; vector<int> mxlis[15];
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cin >> n >> m;
	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) --ret;
				}
				mxlis[j].clear();
			}
			if (mx[j] == x) {
				mxlis[j].push_back(i);
				if (d[i] == 0) ++ret;
				++d[i];
			}
		}
		cout << ret << '\n';
	}
	return 0;
}
0