結果
問題 | No.5018 Let's Make a Best-seller Book |
ユーザー | naut3 |
提出日時 | 2023-10-01 14:16:14 |
言語 | Rust (1.77.0 + proconio) |
結果 |
AC
|
実行時間 | 31 ms / 400 ms |
コード長 | 2,192 bytes |
コンパイル時間 | 1,301 ms |
コンパイル使用メモリ | 154,028 KB |
実行使用メモリ | 24,384 KB |
スコア | 3,856 |
平均クエリ数 | 52.00 |
最終ジャッジ日時 | 2023-10-01 14:16:24 |
合計ジャッジ時間 | 9,285 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 31 ms
23,388 KB |
testcase_01 | AC | 27 ms
24,384 KB |
testcase_02 | AC | 28 ms
23,820 KB |
testcase_03 | AC | 27 ms
23,616 KB |
testcase_04 | AC | 27 ms
23,508 KB |
testcase_05 | AC | 28 ms
24,048 KB |
testcase_06 | AC | 27 ms
23,664 KB |
testcase_07 | AC | 27 ms
23,832 KB |
testcase_08 | AC | 27 ms
24,024 KB |
testcase_09 | AC | 27 ms
23,964 KB |
testcase_10 | AC | 27 ms
23,832 KB |
testcase_11 | AC | 27 ms
23,412 KB |
testcase_12 | AC | 27 ms
23,664 KB |
testcase_13 | AC | 27 ms
23,388 KB |
testcase_14 | AC | 27 ms
23,652 KB |
testcase_15 | AC | 27 ms
23,544 KB |
testcase_16 | AC | 27 ms
23,664 KB |
testcase_17 | AC | 27 ms
23,640 KB |
testcase_18 | AC | 27 ms
23,412 KB |
testcase_19 | AC | 27 ms
23,376 KB |
testcase_20 | AC | 27 ms
23,412 KB |
testcase_21 | AC | 27 ms
24,012 KB |
testcase_22 | AC | 27 ms
24,324 KB |
testcase_23 | AC | 27 ms
23,532 KB |
testcase_24 | AC | 27 ms
24,060 KB |
testcase_25 | AC | 27 ms
23,412 KB |
testcase_26 | AC | 27 ms
23,388 KB |
testcase_27 | AC | 27 ms
24,000 KB |
testcase_28 | AC | 26 ms
23,664 KB |
testcase_29 | AC | 27 ms
24,048 KB |
testcase_30 | AC | 27 ms
23,628 KB |
testcase_31 | AC | 26 ms
24,048 KB |
testcase_32 | AC | 26 ms
24,264 KB |
testcase_33 | AC | 27 ms
24,252 KB |
testcase_34 | AC | 25 ms
23,820 KB |
testcase_35 | AC | 27 ms
23,412 KB |
testcase_36 | AC | 27 ms
23,628 KB |
testcase_37 | AC | 27 ms
24,036 KB |
testcase_38 | AC | 27 ms
23,520 KB |
testcase_39 | AC | 27 ms
24,384 KB |
testcase_40 | AC | 27 ms
23,832 KB |
testcase_41 | AC | 27 ms
23,364 KB |
testcase_42 | AC | 27 ms
23,832 KB |
testcase_43 | AC | 27 ms
23,376 KB |
testcase_44 | AC | 27 ms
24,024 KB |
testcase_45 | AC | 27 ms
23,520 KB |
testcase_46 | AC | 27 ms
23,820 KB |
testcase_47 | AC | 26 ms
24,384 KB |
testcase_48 | AC | 27 ms
23,376 KB |
testcase_49 | AC | 27 ms
23,376 KB |
testcase_50 | AC | 27 ms
24,036 KB |
testcase_51 | AC | 27 ms
23,664 KB |
testcase_52 | AC | 27 ms
23,592 KB |
testcase_53 | AC | 27 ms
23,616 KB |
testcase_54 | AC | 27 ms
24,348 KB |
testcase_55 | AC | 27 ms
23,628 KB |
testcase_56 | AC | 27 ms
24,336 KB |
testcase_57 | AC | 27 ms
23,388 KB |
testcase_58 | AC | 27 ms
23,376 KB |
testcase_59 | AC | 27 ms
23,400 KB |
testcase_60 | AC | 27 ms
24,312 KB |
testcase_61 | AC | 27 ms
23,640 KB |
testcase_62 | AC | 26 ms
24,324 KB |
testcase_63 | AC | 27 ms
23,376 KB |
testcase_64 | AC | 27 ms
24,012 KB |
testcase_65 | AC | 27 ms
23,520 KB |
testcase_66 | AC | 27 ms
24,024 KB |
testcase_67 | AC | 27 ms
23,628 KB |
testcase_68 | AC | 27 ms
24,036 KB |
testcase_69 | AC | 27 ms
23,364 KB |
testcase_70 | AC | 27 ms
23,388 KB |
testcase_71 | AC | 27 ms
24,372 KB |
testcase_72 | AC | 26 ms
23,520 KB |
testcase_73 | AC | 27 ms
23,376 KB |
testcase_74 | AC | 27 ms
23,640 KB |
testcase_75 | AC | 27 ms
24,024 KB |
testcase_76 | AC | 27 ms
24,252 KB |
testcase_77 | AC | 27 ms
23,520 KB |
testcase_78 | AC | 26 ms
23,424 KB |
testcase_79 | AC | 27 ms
23,364 KB |
testcase_80 | AC | 27 ms
23,508 KB |
testcase_81 | AC | 27 ms
24,324 KB |
testcase_82 | AC | 27 ms
24,024 KB |
testcase_83 | AC | 27 ms
24,264 KB |
testcase_84 | AC | 27 ms
23,832 KB |
testcase_85 | AC | 27 ms
23,832 KB |
testcase_86 | AC | 27 ms
23,232 KB |
testcase_87 | AC | 27 ms
24,372 KB |
testcase_88 | AC | 27 ms
24,048 KB |
testcase_89 | AC | 26 ms
24,348 KB |
testcase_90 | AC | 27 ms
24,120 KB |
testcase_91 | AC | 26 ms
23,628 KB |
testcase_92 | AC | 27 ms
24,312 KB |
testcase_93 | AC | 27 ms
24,012 KB |
testcase_94 | AC | 27 ms
23,412 KB |
testcase_95 | AC | 27 ms
24,324 KB |
testcase_96 | AC | 27 ms
23,412 KB |
testcase_97 | AC | 27 ms
23,520 KB |
testcase_98 | AC | 27 ms
23,400 KB |
testcase_99 | AC | 26 ms
23,892 KB |
コンパイルメッセージ
warning: value assigned to `M` is never read --> Main.rs:17:13 | 17 | let mut M = input!(usize); | ^ | = help: maybe it is overwritten before being read? = note: `#[warn(unused_assignments)]` on by default warning: variable `S` is assigned to, but never used --> Main.rs:19:13 | 19 | let mut S = vec![]; | ^ | = note: consider using `_S` instead = note: `#[warn(unused_variables)]` on by default warning: variable `P` is assigned to, but never used --> Main.rs:20:13 | 20 | let mut P = vec![]; | ^ | = note: consider using `_P` instead warning: variable `R` is assigned to, but never used --> Main.rs:21:13 | 21 | let mut R = vec![]; | ^ | = note: consider using `_R` instead warning: value assigned to `S` is never read --> Main.rs:34:9 | 34 | S = input!(usize, N); | ^ | = help: maybe it is overwritten before being read? warning: value assigned to `P` is never read --> Main.rs:35:9 | 35 | P = input!(isize, N); | ^ | = help: maybe it is overwritten before being read? warning: value assigned to `R` is never read --> Main.rs:36:9 | 36 | R = input!(usize, N); | ^ | = help: maybe it is overwritten before being read? warning: value assigned to `S` is never read --> Main.rs:69:13 | 69 | S = input!(usize, N); | ^ | = help: maybe it is overwritten before being read? warning: value assigned to `P` is never read --> Main.rs:70:13 | 70 | P = input!(isize, N); | ^ | = help: maybe it is overwritten before being read? warning: value assigned to `R` is never read --> Main.rs:71:13 | 71 | R = input!(usize, N); | ^ | = help: maybe it is overwritten before being read? warning: 10 warnings emitted
ソースコード
#![allow(unused_must_use, non_snake_case)] use std::io::{stdin, stdout, BufWriter, Write}; fn main() { let mut scan = Scanner::default(); macro_rules! input { ($T: ty) => { scan.next::<$T>() }; ($T: ty, $N: expr) => { (0..$N).map(|_| scan.next::<$T>()).collect::<Vec<_>>() }; } let T = input!(usize); let N = input!(usize); let mut M = input!(usize); let mut S = vec![]; let mut P = vec![]; let mut R = vec![]; // g >= 3 を最初にやったら M = 0 になる :( let g = 2; { let out = &mut BufWriter::new(stdout()); writeln!(out, "2 {}", g); } { M = input!(usize); S = input!(usize, N); P = input!(isize, N); R = input!(usize, N); } for _ in 1..T { let C = M / 500; // output { let out = &mut BufWriter::new(stdout()); // let sum_of_weight = P.iter().map(|&p| if p >= 0 { p } else { 0 }).sum::<isize>(); // assert!(sum_of_weight > 0); // let L = (0..N) // .map(|i| C * (if P[i] >= 0 { P[i] } else { 0 }) as usize / sum_of_weight as usize) // .collect::<Vec<_>>(); let L = vec![C / N; N]; writeln!( out, "1 {}", L.iter() .map(|x| x.to_string()) .collect::<Vec<_>>() .join(" ") ); } // input { M = input!(usize); S = input!(usize, N); P = input!(isize, N); R = input!(usize, N); } } } #[derive(Default)] struct Scanner { buffer: Vec<String>, } impl Scanner { fn next<T: std::str::FromStr>(&mut self) -> T { loop { if let Some(token) = self.buffer.pop() { return token.parse().ok().expect("Failed parse"); } let mut input = String::new(); stdin().read_line(&mut input).expect("Failed read"); self.buffer = input.split_whitespace().rev().map(String::from).collect(); } } }