Submission #16242933
Source Code Expand
use proconio::input;
fn main() {
input! {
n: usize,
a: [i64; n],
b: [i64; n],
};
let mut d = 0_i64;
for (&a_i, &b_i) in a.iter().zip(b.iter()) {
if a_i == b_i {
continue;
}
if a_i < b_i {
d += (b_i - a_i) / 2;
} else {
d += b_i - a_i;
}
}
let ans = d >= 0;
println!("{}", if ans { "Yes" } else { "No" });
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Two Arrays |
| User | bouzuya |
| Language | Rust (1.42.0) |
| Score | 300 |
| Code Size | 436 Byte |
| Status | AC |
| Exec Time | 8 ms |
| Memory | 2500 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_000.txt, 0_001.txt, 0_002.txt |
| All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_000.txt | AC | 6 ms | 2084 KiB |
| 0_001.txt | AC | 2 ms | 2156 KiB |
| 0_002.txt | AC | 2 ms | 2132 KiB |
| 1_003.txt | AC | 3 ms | 2348 KiB |
| 1_004.txt | AC | 3 ms | 2192 KiB |
| 1_005.txt | AC | 4 ms | 2488 KiB |
| 1_006.txt | AC | 5 ms | 2396 KiB |
| 1_007.txt | AC | 4 ms | 2464 KiB |
| 1_008.txt | AC | 4 ms | 2244 KiB |
| 1_009.txt | AC | 3 ms | 2376 KiB |
| 1_010.txt | AC | 5 ms | 2460 KiB |
| 1_011.txt | AC | 4 ms | 2448 KiB |
| 1_012.txt | AC | 4 ms | 2372 KiB |
| 1_013.txt | AC | 3 ms | 2364 KiB |
| 1_014.txt | AC | 3 ms | 2316 KiB |
| 1_015.txt | AC | 3 ms | 2376 KiB |
| 1_016.txt | AC | 4 ms | 2432 KiB |
| 1_017.txt | AC | 4 ms | 2456 KiB |
| 1_018.txt | AC | 4 ms | 2252 KiB |
| 1_019.txt | AC | 4 ms | 2316 KiB |
| 1_020.txt | AC | 3 ms | 2416 KiB |
| 1_021.txt | AC | 4 ms | 2404 KiB |
| 1_022.txt | AC | 3 ms | 2248 KiB |
| 1_023.txt | AC | 3 ms | 2500 KiB |
| 1_024.txt | AC | 3 ms | 2416 KiB |
| 1_025.txt | AC | 2 ms | 2320 KiB |
| 1_026.txt | AC | 8 ms | 2456 KiB |
| 1_027.txt | AC | 5 ms | 2340 KiB |