結果
問題 |
No.709 優勝可能性
|
ユーザー |
|
提出日時 | 2018-08-29 17:27:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 861 bytes |
コンパイル時間 | 705 ms |
コンパイル使用メモリ | 79,712 KB |
実行使用メモリ | 10,396 KB |
最終ジャッジ日時 | 2024-09-13 19:29:37 |
合計ジャッジ時間 | 6,198 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 10 TLE * 1 -- * 11 |
ソースコード
#include<iostream> #include<vector> #include<set> using namespace std; int main(){ int n, m, r; scanf("%d %d", &n, &m); vector<pair<int,set<int>>> p(10); for(int i = 0; i < m; i++){ scanf("%d", &r); set<int> tmp; tmp.insert(0); p[i] = {r, tmp}; } printf("1\n"); for(int i = 1; i < n; i++){ for(int j = 0; j < m; j++){ scanf("%d", &r); if(r > p[j].first){ p[j].second.clear(); p[j].second.insert(i); p[j].first = r; }else if(r == p[j].first){ p[j].second.insert(i); } } set<int> candidate; for(int j = 0; j < m; j++){ for(int x : p[j].second) candidate.insert(x); } printf("%d\n", candidate.size()); } return 0; }