結果

問題 No.709 優勝可能性
ユーザー chocoruskchocorusk
提出日時 2018-09-22 15:39:29
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 490 ms / 3,500 ms
コード長 901 bytes
コンパイル時間 1,461 ms
コンパイル使用メモリ 88,556 KB
実行使用メモリ 10,360 KB
最終ジャッジ日時 2023-09-25 11:06:22
合計ジャッジ時間 5,799 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
5,420 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 239 ms
7,620 KB
testcase_11 AC 168 ms
7,652 KB
testcase_12 AC 386 ms
7,728 KB
testcase_13 AC 346 ms
7,728 KB
testcase_14 AC 309 ms
7,616 KB
testcase_15 AC 285 ms
7,708 KB
testcase_16 AC 270 ms
8,036 KB
testcase_17 AC 271 ms
10,360 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 487 ms
7,580 KB
testcase_21 AC 490 ms
7,608 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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;
}
0