Submission #59184998
Source Code Expand
use proconio::input;
pub fn main() {
input! {
n: usize,
m: usize,
lrn: [(usize, usize); n],
}
let mut valid = vec![true; m + 1];
for &(l, r) in &lrn {
for i in l..=r {
valid[i] = false;
}
}
let mut count = 0;
for l in 1..=m {
for r in l..=m {
let mut is_valid = true;
for &(li, ri) in &lrn {
if l <= li && ri <= r {
is_valid = false;
break;
}
}
if is_valid {
count += 1;
}
}
}
println!("{}", count);
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - Many Segments 2 |
| User | macaroon |
| Language | Rust (rustc 1.70.0) |
| Score | 0 |
| Code Size | 696 Byte |
| Status | TLE |
| Exec Time | 2210 ms |
| Memory | 7952 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 1960 KiB |
| 00_sample_01.txt | AC | 1 ms | 1932 KiB |
| 00_sample_02.txt | AC | 0 ms | 2000 KiB |
| 01_handmade_00.txt | AC | 1 ms | 1940 KiB |
| 01_handmade_01.txt | TLE | 2207 ms | 2116 KiB |
| 01_handmade_02.txt | AC | 1 ms | 1964 KiB |
| 01_handmade_03.txt | AC | 0 ms | 1904 KiB |
| 01_handmade_04.txt | AC | 1 ms | 1860 KiB |
| 01_handmade_05.txt | AC | 0 ms | 2044 KiB |
| 02_random_00.txt | TLE | 2207 ms | 3048 KiB |
| 02_random_01.txt | TLE | 2207 ms | 4196 KiB |
| 02_random_02.txt | TLE | 2207 ms | 6928 KiB |
| 02_random_03.txt | TLE | 2207 ms | 5600 KiB |
| 02_random_04.txt | TLE | 2207 ms | 2616 KiB |
| 02_random_05.txt | TLE | 2207 ms | 7220 KiB |
| 02_random_06.txt | TLE | 2207 ms | 5668 KiB |
| 02_random_07.txt | TLE | 2207 ms | 6532 KiB |
| 02_random_08.txt | TLE | 2208 ms | 7952 KiB |
| 02_random_09.txt | TLE | 2208 ms | 7912 KiB |
| 02_random_10.txt | TLE | 2207 ms | 7948 KiB |
| 02_random_11.txt | TLE | 2208 ms | 7900 KiB |
| 02_random_12.txt | TLE | 2207 ms | 7744 KiB |
| 02_random_13.txt | TLE | 2207 ms | 2056 KiB |
| 02_random_14.txt | TLE | 2207 ms | 2116 KiB |
| 02_random_15.txt | TLE | 2207 ms | 2188 KiB |
| 02_random_16.txt | AC | 8 ms | 5732 KiB |
| 02_random_17.txt | AC | 7 ms | 5740 KiB |
| 02_random_18.txt | AC | 7 ms | 5684 KiB |
| 02_random_19.txt | TLE | 2207 ms | 6860 KiB |
| 02_random_20.txt | TLE | 2210 ms | 7000 KiB |
| 02_random_21.txt | TLE | 2207 ms | 7784 KiB |
| 02_random_22.txt | TLE | 2207 ms | 7940 KiB |