結果

問題 No.709 優勝可能性
ユーザー dnishdnish
提出日時 2018-06-30 01:04:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 785 ms / 3,500 ms
コード長 1,168 bytes
コンパイル時間 1,650 ms
コンパイル使用メモリ 177,276 KB
実行使用メモリ 42,752 KB
最終ジャッジ日時 2023-09-13 16:02:05
合計ジャッジ時間 7,317 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 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,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 239 ms
13,076 KB
testcase_11 AC 177 ms
12,944 KB
testcase_12 AC 396 ms
13,600 KB
testcase_13 AC 360 ms
12,772 KB
testcase_14 AC 322 ms
12,880 KB
testcase_15 AC 311 ms
13,212 KB
testcase_16 AC 451 ms
17,288 KB
testcase_17 AC 785 ms
42,752 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 489 ms
12,764 KB
testcase_21 AC 497 ms
12,764 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long int ll;
using namespace std;
const ll inf=1e18;

ll N,M;
ll R[100010][12];
int main(){
    while(cin>>N>>M) {
        map<ll,ll> mp;
        ll mx[12];
        set<ll> kouho[12];
        REP(i, 0, 11) mx[i] = 0;
        REP(i, 0, N) {
            REP(j, 0, M) {
                cin >> R[i][j];
            }
        }
        REP(i, 0, N) {
            REP(j, 0, M) {
                if (R[i][j] > mx[j]) {
                    mx[j] = R[i][j];
                    for (auto ss: kouho[j]) {
                        mp[ss]--;
                        if (mp[ss] == 0) mp.erase(ss);
                    }
                    kouho[j].clear();
                }
                if (R[i][j] == mx[j]) {
                    kouho[j].insert(i);
                    mp[i]++;
                }
            }
            p(mp.size());
        }
    }
    return 0;
}
0