QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#268421#4939. Red Black BallZhaoZiLongCompile Error//Rust5.7kb2023-11-28 17:12:052023-11-28 17:12:06

详细

error[E0308]: mismatched types
   --> answer.code:114:21
    |
114 |         nck[i][0] = nck[i][i] = 1;
    |         ---------   ^^^^^^^^^^^^^ expected `i32`, found `()`
    |         |
    |         expected due to the type of this binding

error[E0618]: expected function, found `Vec<Vec<i32>>`
   --> answer.code:212:38
    |
107 |     let mut nck: Vec<Vec<i32>> = vec![vec![0; MAXN]; MAXN];
    |         ------- `nck` has type `Vec<Vec<i32>>`
...
212 |         n_way_inter = (n_way_inter * nck(m_var, _size[i])) % MOD;
    |                                      ^^^-----------------
    |                                      |
    |                                      call expression requires function

error[E0618]: expected function, found `Vec<i32>`
   --> answer.code:216:24
    |
106 |     let mut fac: Vec<i32> = vec![1; MAXN];
    |         ------- `fac` has type `Vec<i32>`
...
216 |     let n_way_fixed = (fac(n_fixed) * nck(m, n_fixed)) % MOD;
    |                        ^^^---------
    |                        |
    |                        call expression requires function

error[E0618]: expected function, found `Vec<Vec<i32>>`
   --> answer.code:216:39
    |
107 |     let mut nck: Vec<Vec<i32>> = vec![vec![0; MAXN]; MAXN];
    |         ------- `nck` has type `Vec<Vec<i32>>`
...
216 |     let n_way_fixed = (fac(n_fixed) * nck(m, n_fixed)) % MOD;
    |                                       ^^^------------
    |                                       |
    |                                       call expression requires function

error[E0308]: mismatched types
   --> answer.code:219:54
    |
219 |     for k in cmp::max(n_a, (n + m) as i32 / 2 + 1)..=n + m {
    |              ----------------------------------------^^^^^
    |              |                                       |
    |              |                                       expected `i32`, found `usize`
    |              arguments to this function are incorrect
    |
note: associated function defined here
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
    |
219 |     for k in cmp::max(n_a, (n + m) as i32 / 2 + 1)..=(n + m).try_into().unwrap() {
    |                                                      +     +++++++++++++++++++++

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0308, E0618.
For more information about an error, try `rustc --explain E0308`.