結果

問題 No.709 優勝可能性
ユーザー rpy3cpprpy3cpp
提出日時 2018-08-11 23:51:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 124 ms / 3,500 ms
コード長 913 bytes
コンパイル時間 1,517 ms
コンパイル使用メモリ 172,756 KB
実行使用メモリ 6,632 KB
最終ジャッジ日時 2023-10-24 14:17:04
合計ジャッジ時間 3,682 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 43 ms
4,348 KB
testcase_11 AC 20 ms
4,348 KB
testcase_12 AC 90 ms
4,348 KB
testcase_13 AC 88 ms
4,348 KB
testcase_14 AC 80 ms
4,348 KB
testcase_15 AC 72 ms
4,348 KB
testcase_16 AC 70 ms
4,348 KB
testcase_17 AC 73 ms
6,632 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 124 ms
4,348 KB
testcase_21 AC 124 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<int> Record(M, 0);
    vector<vector<int>> candidates(M);
    vector<int> status(N, 0);
    int num = 0;
    for (int n = 0; n < N; ++n){
        for (int m = 0; m < M; ++m){
            int R;
            cin >> R;
            if (R > Record[m]){
                if (status[n] == 0) ++num;
                ++status[n];
                Record[m] = R;
                for (auto c : candidates[m]){
                    --status[c];
                    if (status[c] == 0) --num;
                }
                candidates[m] = {n};
            }else if(R == Record[m]){
                if (status[n] == 0) ++num;
                ++status[n];
                candidates[m].push_back(n);
            }
        }
        cout << num << '\n';
    }
    return 0;
}
0