Submission #39729054
Source Code Expand
use proconio::{input, marker::Usize1};
fn main() {
input! {
n: usize,
lr: [(Usize1, Usize1); n],
};
let mut seats = vec![0_i64; 100_000 + 1];
for (l, r) in lr {
seats[l] += 1;
seats[r + 1] -= 1;
}
for i in 0..100_000 {
seats[i + 1] += seats[i];
}
let ans = seats.iter().sum::<i64>();
println!("{}", ans);
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Theater |
| User | bouzuya |
| Language | Rust (1.42.0) |
| Score | 200 |
| Code Size | 384 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 2824 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 7 ms | 2744 KiB |
| 02.txt | AC | 2 ms | 2676 KiB |
| 03.txt | AC | 2 ms | 2740 KiB |
| 04.txt | AC | 2 ms | 2824 KiB |
| 05.txt | AC | 2 ms | 2784 KiB |
| 06.txt | AC | 2 ms | 2788 KiB |
| sample_01.txt | AC | 2 ms | 2796 KiB |
| sample_02.txt | AC | 2 ms | 2744 KiB |