結果
問題 | No.2684 折々の色 |
ユーザー | naut3 |
提出日時 | 2024-03-20 23:04:09 |
言語 | Rust (1.77.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,561 bytes |
コンパイル時間 | 12,363 ms |
コンパイル使用メモリ | 387,908 KB |
実行使用メモリ | 56,916 KB |
最終ジャッジ日時 | 2024-09-30 09:11:29 |
合計ジャッジ時間 | 24,526 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,820 KB |
testcase_01 | AC | 1 ms
6,820 KB |
testcase_02 | AC | 1 ms
6,816 KB |
testcase_03 | AC | 0 ms
6,816 KB |
testcase_04 | AC | 1 ms
6,816 KB |
testcase_05 | AC | 1 ms
6,816 KB |
testcase_06 | AC | 1 ms
6,816 KB |
testcase_07 | AC | 1 ms
6,820 KB |
testcase_08 | AC | 1 ms
6,816 KB |
testcase_09 | AC | 1 ms
6,816 KB |
testcase_10 | AC | 1 ms
6,816 KB |
testcase_11 | AC | 132 ms
25,600 KB |
testcase_12 | AC | 81 ms
18,176 KB |
testcase_13 | AC | 159 ms
30,004 KB |
testcase_14 | AC | 57 ms
15,872 KB |
testcase_15 | AC | 85 ms
20,992 KB |
testcase_16 | WA | - |
testcase_17 | AC | 70 ms
16,640 KB |
testcase_18 | AC | 137 ms
28,240 KB |
testcase_19 | AC | 161 ms
31,104 KB |
testcase_20 | WA | - |
testcase_21 | AC | 37 ms
8,832 KB |
testcase_22 | AC | 169 ms
28,768 KB |
testcase_23 | AC | 112 ms
23,296 KB |
testcase_24 | AC | 46 ms
11,392 KB |
testcase_25 | AC | 91 ms
16,128 KB |
testcase_26 | AC | 196 ms
29,952 KB |
testcase_27 | AC | 120 ms
20,096 KB |
testcase_28 | AC | 141 ms
23,168 KB |
testcase_29 | AC | 311 ms
53,424 KB |
testcase_30 | WA | - |
testcase_31 | AC | 247 ms
48,144 KB |
testcase_32 | WA | - |
testcase_33 | AC | 287 ms
56,128 KB |
testcase_34 | AC | 341 ms
48,504 KB |
testcase_35 | AC | 287 ms
48,440 KB |
testcase_36 | WA | - |
testcase_37 | AC | 264 ms
50,008 KB |
testcase_38 | AC | 397 ms
56,512 KB |
testcase_39 | AC | 356 ms
56,916 KB |
testcase_40 | AC | 434 ms
54,708 KB |
testcase_41 | AC | 401 ms
54,960 KB |
testcase_42 | AC | 364 ms
54,988 KB |
testcase_43 | AC | 390 ms
54,692 KB |
testcase_44 | AC | 403 ms
54,940 KB |
testcase_45 | AC | 379 ms
54,612 KB |
testcase_46 | AC | 400 ms
54,596 KB |
testcase_47 | AC | 1 ms
6,820 KB |
testcase_48 | AC | 0 ms
6,816 KB |
testcase_49 | AC | 0 ms
6,816 KB |
testcase_50 | AC | 1 ms
6,816 KB |
testcase_51 | AC | 1 ms
6,816 KB |
testcase_52 | AC | 1 ms
6,816 KB |
testcase_53 | AC | 1 ms
6,816 KB |
testcase_54 | AC | 1 ms
6,820 KB |
testcase_55 | AC | 0 ms
6,820 KB |
testcase_56 | AC | 0 ms
6,816 KB |
testcase_57 | WA | - |
ソースコード
#![allow(non_snake_case, unused_imports, unused_must_use)] use std::io::{self, prelude::*}; use std::str; fn main() { let (stdin, stdout) = (io::stdin(), io::stdout()); let mut scan = Scanner::new(stdin.lock()); let mut out = io::BufWriter::new(stdout.lock()); macro_rules! input { ($T: ty) => { scan.token::<$T>() }; ($T: ty, $N: expr) => { (0..$N).map(|_| scan.token::<$T>()).collect::<Vec<_>>() }; } let N = input!(usize); let M = input!(usize); let X = input!(isize, M); let mut C = vec![]; let mut T = vec![]; let mut cards = vec![]; for i in 0..N { let c = input!(isize, M); let t = input!(isize); let z = c.iter().map(|&v| v * t).collect::<Vec<_>>(); C.push(c); T.push(t); cards.push((z, i)); } cards.sort(); // for c in cards.iter() { // writeln!(out, "order: {}", c.1); // } // 表が i だとして裏を決めたい for i in 0..N { let t = T[i]; let c = &C[i]; let mut LR = vec![]; let mut ok = 0; let mut ng = N; for j in 0..M { let cj = c[j]; let xj = X[j]; let left = 100 - t; let right = 10000 * xj - 100 * t * cj; { let mut okl = ok; let mut okr = ng; while okr - okl > 1 { let m = (okl + okr) / 2; let c = cards[m].0[j]; if c * left <= right { okl = m; } else { okr = m; } } ok = okl; } { let mut ngl = ok; let mut ngr = ng; while ngr - ngl > 1 { let m = (ngl + ngr) / 2; let c = cards[m].0[j]; if c * left <= right { ngl = m; } else { ngr = m; } } ng = ngr; } LR.push((left, right)); } for j in ok..ng { if cards[j].1 != i { let mut isok = true; for k in 0..M { let (left, right) = LR[k]; if left * cards[j].0[k] != right { isok = false; } } if isok { writeln!(out, "Yes"); return; } } } } writeln!(out, "No"); } struct Scanner<R> { reader: R, buf_str: Vec<u8>, buf_iter: str::SplitWhitespace<'static>, } impl<R: BufRead> Scanner<R> { fn new(reader: R) -> Self { Self { reader, buf_str: vec![], buf_iter: "".split_whitespace(), } } fn token<T: str::FromStr>(&mut self) -> T { loop { if let Some(token) = self.buf_iter.next() { return token.parse().ok().expect("Failed parse"); } self.buf_str.clear(); self.reader .read_until(b'\n', &mut self.buf_str) .expect("Failed read"); self.buf_iter = unsafe { let slice = str::from_utf8_unchecked(&self.buf_str); std::mem::transmute(slice.split_whitespace()) } } } }