結果
問題 | No.709 優勝可能性 |
ユーザー |
|
提出日時 | 2018-06-29 22:49:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 400 ms / 3,500 ms |
コード長 | 970 bytes |
コンパイル時間 | 1,778 ms |
コンパイル使用メモリ | 180,976 KB |
実行使用メモリ | 17,668 KB |
最終ジャッジ日時 | 2024-07-01 00:05:57 |
合計ジャッジ時間 | 5,674 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main() {cin.tie(0);ios::sync_with_stdio(false);int n, m;cin >> n >> m;vector< vector<int> > cur(m);vector< vector<int> > r(n, vector<int>(m));map<int, int> cnt;for (int i = 0; i < n; i++) {for (int j = 0; j < m; j++) {cin >> r[i][j];if (cur[j].empty() || r[i][j] == r[cur[j].front()][j]) {cur[j].push_back(i);cnt[i]++;} else if (r[i][j] > r[cur[j].front()][j]) {while (!cur[j].empty()) {cnt[cur[j].back()]--;if (cnt[cur[j].back()] == 0) {cnt.erase(cur[j].back());}cur[j].pop_back();}cur[j].push_back(i);cnt[i]++;}}cout << cnt.size() << endl;}return 0;}