Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
ArXiv:
Tags:
competitive-programming
code-generation
specification-generation
proof-generation
verification
rust
License:
File size: 453 Bytes
b2a430f | 1 2 3 4 5 6 7 8 9 10 | impl Solution {
pub fn check_overlap(radius: i32, x_center: i32, y_center: i32, x1: i32, y1: i32, x2: i32, y2: i32) -> bool {
let nearest_x = if x_center < x1 { x1 } else if x_center > x2 { x2 } else { x_center };
let nearest_y = if y_center < y1 { y1 } else if y_center > y2 { y2 } else { y_center };
let dx = x_center - nearest_x;
let dy = y_center - nearest_y;
dx * dx + dy * dy <= radius * radius
}
}
|