結果

問題 No.709 優勝可能性
ユーザー どららどらら
提出日時 2018-06-29 23:12:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,405 ms / 3,500 ms
コード長 823 bytes
コンパイル時間 1,699 ms
コンパイル使用メモリ 177,164 KB
実行使用メモリ 57,476 KB
最終ジャッジ日時 2023-09-13 15:38:18
合計ジャッジ時間 9,188 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 269 ms
8,776 KB
testcase_11 AC 180 ms
8,872 KB
testcase_12 AC 438 ms
10,468 KB
testcase_13 AC 649 ms
15,236 KB
testcase_14 AC 437 ms
11,044 KB
testcase_15 AC 355 ms
10,400 KB
testcase_16 AC 307 ms
10,372 KB
testcase_17 AC 291 ms
10,400 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1,405 ms
57,400 KB
testcase_21 AC 1,387 ms
57,476 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int main(){
  int N, M;
  cin >> N >> M;
  vector<vector<int>> v(N, vector<int>(M));
  vector<int> mx(M, -1);
  vector<map<int,int>> mp(M);
  rep(i,N){
    rep(j,M){
      cin >> v[i][j];
      mx[j] = max(mx[j], v[i][j]);
      mp[j][mx[j]] = i;
    }
  }

  vector<int> ret(N+1,0);
  rep(i,N){
    int x = -1;
    rep(j,M){
      x = max(x, mp[j][v[i][j]]);
    }
    if(i <= x){
      ret[i]++;
      ret[x+1]--;
    }
  }

  int base = 0;
  rep(i,N){
    base += ret[i];
    cout << base << endl;
  }
  
  return 0;
}
0