結果

問題 No.709 優勝可能性
ユーザー chocorusk
提出日時 2018-09-22 15:39:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 488 ms / 3,500 ms
コード長 901 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 88,464 KB
実行使用メモリ 10,284 KB
最終ジャッジ日時 2024-07-18 08:59:16
合計ジャッジ時間 5,191 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int main()
{
int n, m;
cin>>n>>m;
int r[100000][10];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin>>r[i][j];
}
}
int ct=0;
int c[100001];
int mx[10]={};
vector<int> v[10];
for(int i=0; i<n; i++){
c[i]=0;
for(int j=0; j<m; j++){
if(mx[j]<r[i][j]){
mx[j]=r[i][j];
while(!v[j].empty()){
int x=v[j].back();
c[x]--;
if(c[x]==0) ct--;
v[j].pop_back();
}
c[i]++;
v[j].push_back(i);
}else if(mx[j]==r[i][j]){
c[i]++;
v[j].push_back(i);
}
}
if(c[i]>0) ct++;
cout<<ct<<endl;
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0