結果

問題 No.709 優勝可能性
ユーザー face4face4
提出日時 2018-08-29 17:22:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 838 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 79,596 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-11 20:38:31
合計ジャッジ時間 8,824 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 TLE -
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,vector<int>>> p(10);

    for(int i = 0; i < m; i++){
        scanf("%d", &r);
        p[i] = {r, vector<int>(1, 0)};
    }
    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.push_back(r);
                p[j].first = r;
            }else if(r == p[j].first){
                p[j].second.push_back(r);
            }
        }
        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