結果
問題 | No.709 優勝可能性 |
ユーザー |
|
提出日時 | 2024-09-05 10:02:02 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 197 ms / 3,500 ms |
コード長 | 855 bytes |
コンパイル時間 | 14,392 ms |
コンパイル使用メモリ | 409,408 KB |
実行使用メモリ | 23,424 KB |
最終ジャッジ日時 | 2024-09-05 10:02:22 |
合計ジャッジ時間 | 18,653 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
use proconio::input;fn main() {input! {n:usize,m:usize,r:[[usize;m];n],}let mut ans = 0;let mut cnts = vec![0; n];let mut ids_max = vec![vec![]; m];let mut maxs = vec![0; m];for i in 0..n {for j in 0..m {if maxs[j] < r[i][j] {while let Some(id) = ids_max[j].pop() {cnts[id] -= 1;if cnts[id] == 0 {ans -= 1;}}ids_max[j].push(i);maxs[j] = r[i][j];cnts[i] += 1;}if maxs[j] == r[i][j] {ids_max[j].push(i);cnts[i] += 1;}}if cnts[i] > 0 {ans += 1;}println!("{}", ans);}}