結果
| 問題 | No.709 優勝可能性 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-11 23:42:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 125 ms / 3,500 ms |
| コード長 | 943 bytes |
| 記録 | |
| コンパイル時間 | 1,759 ms |
| コンパイル使用メモリ | 173,712 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2024-09-23 06:39:08 |
| 合計ジャッジ時間 | 5,448 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M;
cin >> N >> M;
vector<int> Record(M, 0);
vector<vector<int>> candidates(M);
vector<int> status(N, 0);
int num = 0;
for (int n = 0; n < N; ++n){
for (int m = 0; m < M; ++m){
int R;
cin >> R;
if (R > Record[m]){
if (status[n] == 0) ++num;
status[n] |= (1 << m);
Record[m] = R;
for (auto c : candidates[m]){
status[c] ^= (1 << m);
if (status[c] == 0) --num;
}
candidates[m] = {n};
}else if(R == Record[m]){
if (status[n] == 0) ++num;
status[n] |= (1 << m);
candidates[m].push_back(n);
}
}
cout << num << '\n';
}
return 0;
}