結果

問題 No.709 優勝可能性
ユーザー kotatsugame
提出日時 2018-06-29 23:02:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 501 bytes
コンパイル時間 698 ms
コンパイル使用メモリ 75,200 KB
実行使用メモリ 7,412 KB
最終ジャッジ日時 2024-07-01 00:09:09
合計ジャッジ時間 6,212 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
using namespace std;
int n,m;
int R[11];
int cnt[1<<17];
vector<int>a[11];
int MR[11];
int ans;
main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			cin>>R[j];
			if(MR[j]<R[j])
			{
				MR[j]=R[j];
				for(int k=0;k<a[j].size();k++)ans-=!--cnt[a[j][k]];
				a[j].push_back(i);
				ans+=!cnt[i]++;
			}
			else if(MR[j]==R[j])
			{
				a[j].push_back(i);
				ans+=!cnt[i]++;
			}
		}
		cout<<ans<<endl;
	}
}
0