結果

問題 No.709 優勝可能性
ユーザー face4face4
提出日時 2018-08-29 17:27:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 861 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 80,332 KB
実行使用メモリ 7,816 KB
最終ジャッジ日時 2023-10-11 20:38:40
合計ジャッジ時間 6,318 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
using namespace std;

int main(){
    int n, m, r;
    scanf("%d %d", &n, &m);

    vector<pair<int,set<int>>> p(10);

    for(int i = 0; i < m; i++){
        scanf("%d", &r);
        set<int> tmp;
        tmp.insert(0);
        p[i] = {r, tmp};
    }

    printf("1\n");

    for(int i = 1; i < n; i++){
        for(int j = 0; j < m; j++){
            scanf("%d", &r);
            if(r > p[j].first){
                p[j].second.clear();
                p[j].second.insert(i);
                p[j].first = r;
            }else if(r == p[j].first){
                p[j].second.insert(i);
            }
        }
        set<int> candidate;
        for(int j = 0; j < m; j++){
            for(int x : p[j].second)    candidate.insert(x);
        }
        printf("%d\n", candidate.size());
    }

    return 0;
}
0