結果
問題 | No.709 優勝可能性 |
ユーザー |
|
提出日時 | 2018-10-18 09:25:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 763 bytes |
コンパイル時間 | 876 ms |
コンパイル使用メモリ | 83,232 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-10-14 15:35:56 |
合計ジャッジ時間 | 6,560 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 10 TLE * 1 -- * 11 |
ソースコード
#include <iostream> #include <vector> #include <map> #include <set> using namespace std; typedef long long LL; int N,M; int GetWinNum(vector<multimap<LL,int,greater<LL>>> &R) { int num=0; set<int> PersonSet; multimap<LL,int,greater<LL>>::iterator mit; for (int j=0;j<M;j++){ mit=R[j].begin(); LL maxV=(*mit).first; for (;mit!=R[j].end();mit++){ if (maxV==(*mit).first){ PersonSet.insert((*mit).second); }else{ break; } } } num=PersonSet.size(); return num; } int main(int argc, char* argv[]) { cin>>N>>M; vector<multimap<LL,int,greater<LL>>> R(M); int i,j; LL r; for (i=0;i<N;i++){ for (j=0;j<M;j++){ cin>>r; R[j].insert(multimap<LL,int,greater<LL>>::value_type(r,i+1)); } cout<<GetWinNum(R)<<endl; } return 0; }