結果

問題 No.709 優勝可能性
ユーザー merom686merom686
提出日時 2018-06-29 23:09:38
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 116 ms / 3,500 ms
コード長 1,056 bytes
コンパイル時間 659 ms
コンパイル使用メモリ 77,732 KB
実行使用メモリ 6,404 KB
最終ジャッジ日時 2023-09-13 15:36:55
合計ジャッジ時間 3,078 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 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,380 KB
testcase_10 AC 41 ms
4,376 KB
testcase_11 AC 18 ms
4,376 KB
testcase_12 AC 84 ms
4,376 KB
testcase_13 AC 83 ms
4,380 KB
testcase_14 AC 76 ms
4,376 KB
testcase_15 AC 69 ms
4,376 KB
testcase_16 AC 68 ms
4,380 KB
testcase_17 AC 69 ms
6,404 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 116 ms
4,380 KB
testcase_21 AC 116 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, m;
    cin >> n >> m;

    int s[10] = {};
    vector<int> t(n), v[10];
    for (int j = 0; j < m; j++) {
        v[j] = vector<int>();
    }
    int x = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            int r;
            cin >> r;
            if (r > s[j]) {
                for (auto& i1 : v[j]) {
                    t[i1] ^= 1 << j;
                    if (t[i1] == 0) x--;
                }
                v[j].clear();

                if (t[i] == 0) x++;
                s[j] = r;
                t[i] ^= 1 << j;
                v[j].push_back(i);

            } else if (r == s[j]) {
                if (t[i] == 0) x++;
                t[i] ^= 1 << j;
                v[j].push_back(i);
            }
        }
        cout << x << '\n';
    }

    return 0;
}
0