結果

問題 No.709 優勝可能性
ユーザー merom686merom686
提出日時 2018-06-30 17:57:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 119 ms / 3,500 ms
コード長 979 bytes
コンパイル時間 778 ms
コンパイル使用メモリ 76,472 KB
実行使用メモリ 7,276 KB
最終ジャッジ日時 2023-09-13 16:21:43
合計ジャッジ時間 2,897 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 41 ms
4,632 KB
testcase_11 AC 18 ms
4,376 KB
testcase_12 AC 88 ms
6,216 KB
testcase_13 AC 87 ms
7,260 KB
testcase_14 AC 79 ms
7,236 KB
testcase_15 AC 73 ms
7,260 KB
testcase_16 AC 69 ms
7,196 KB
testcase_17 AC 69 ms
7,256 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 119 ms
7,276 KB
testcase_21 AC 119 ms
7,260 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,376 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] = {}, k[10] = {};
    vector<int> t(n), v[10];
    for (int j = 0; j < m; j++) {
        v[j] = vector<int>(n);
    }
    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]) continue;
            if (r > s[j]) {
                for (int h = 0; h < k[j]; h++) {
                    int i1 = v[j][h];
                    t[i1]--;
                    if (t[i1] == 0) x--;
                }
                k[j] = 0;
                s[j] = r;
            }
            if (t[i] == 0) x++;
            t[i]++;
            v[j][k[j]++] = i;
        }
        cout << x << '\n';
    }

    return 0;
}
0