結果

問題 No.709 優勝可能性
ユーザー koba-e964
提出日時 2018-06-29 22:44:13
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 246 ms / 3,500 ms
コード長 1,252 bytes
コンパイル時間 846 ms
コンパイル使用メモリ 102,008 KB
実行使用メモリ 13,556 KB
最終ジャッジ日時 2024-07-01 00:04:42
合計ジャッジ時間 4,106 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define DEBUGP(val) cerr << #val << "=" << val << "\n"
using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<VI> r(n, VI(m));
REP(i, 0, n) REP(j, 0, m) cin >> r[i][j];
VI ma(m, -1);
vector<VI> ms(m);
VI pop(n);
int ans = 0;
REP(i, 0, n) {
REP(j, 0, m) {
int val = r[i][j];
if (ma[j] < val) {
ma[j] = val;
for (int e: ms[j]) {
pop[e]--;
if (pop[e] == 0) {
ans--;
}
}
ms[j].clear();
}
if (ma[j] == val) {
ms[j].push_back(i);
pop[i]++;
if (pop[i] == 1) ans++;
}
}
cout << ans << endl;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0