結果

問題 No.709 優勝可能性
ユーザー ahe100ahe100
提出日時 2018-07-15 21:08:07
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,075 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 92,224 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-07 02:13:07
合計ジャッジ時間 6,454 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<unordered_set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll mod = 1e9+7;
ll inf = 1e18;

//AC

int main(void){
	ll n,m,r[100010][20];
	vector<ll> winner[20];
	rep(i,20)winner[i].push_back(0);
	cin>>n>>m;
	rep(i,n){
		rep(j,m)cin>>r[i][j];
	}
	rep(i,n){
		unordered_set<ll> s;
		rep(j,m){
			if(r[winner[j][0]][j]<r[i][j]){
				//reset
				winner[j]={i};
			}else if(i>0 && r[winner[j][0]][j]==r[i][j]){
				winner[j].push_back(i);
			}
			rep(k,winner[j].size()){
				s.insert(winner[j][k]);
			}
		}
		cout<<s.size()<<endl;
	}
	// winner[3]={2,3};
	// cout<<winner[3].size()<<endl;
	return 0;
}
0