結果
問題 |
No.709 優勝可能性
|
ユーザー |
![]() |
提出日時 | 2018-06-30 17:57:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 128 ms / 3,500 ms |
コード長 | 979 bytes |
コンパイル時間 | 2,860 ms |
コンパイル使用メモリ | 76,972 KB |
実行使用メモリ | 7,552 KB |
最終ジャッジ日時 | 2024-07-01 00:58:55 |
合計ジャッジ時間 | 2,931 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; int s[10] = {}, k[10] = {}; vector<int> t(n), v[10]; for (int j = 0; j < m; j++) { v[j] = vector<int>(n); } int x = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { int r; cin >> r; if (r < s[j]) continue; if (r > s[j]) { for (int h = 0; h < k[j]; h++) { int i1 = v[j][h]; t[i1]--; if (t[i1] == 0) x--; } k[j] = 0; s[j] = r; } if (t[i] == 0) x++; t[i]++; v[j][k[j]++] = i; } cout << x << '\n'; } return 0; }