結果

問題 No.709 優勝可能性
ユーザー kk
提出日時 2020-09-03 18:39:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 831 bytes
コンパイル時間 2,234 ms
コンパイル使用メモリ 207,216 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-05-03 00:58:07
合計ジャッジ時間 9,207 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 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 <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++)
#define ALL(x) (x).begin(), (x).end()

const double PI = acos(-1);

int r[100000][10];
set<int> cur[10];

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, m;
  cin >> n >> m;
  REP (i, n) REP (j, m) cin >> r[i][j];
  
  REP (i, n) {
    set<int> winner;
    REP (j, m) {
      if (cur[j].empty())
        cur[j].insert(i);
      else {
        int best = r[*cur[j].begin()][j];
        if (r[i][j] == best) {
          cur[j].insert(i);
        } else if (r[i][j] > best) {
          cur[j].clear();
          cur[j].insert(i);
        }
      }
      winner.insert(cur[j].begin(), cur[j].end());
    }
    cout << winner.size() << endl;
  }
  
  return 0;
}
0