Submission #42098229
Source Code Expand
use std::collections::HashSet;
use proconio::{input, marker::Usize1};
fn main() {
input! {
n: usize,
m: usize,
uv: [(Usize1, Usize1); m],
};
let mut edges = HashSet::new();
for (u, v) in uv {
if !(0..n).contains(&u) || !(0..n).contains(&v) {
println!("No");
return;
}
if u == v {
println!("No");
return;
}
if !edges.insert((u.min(v), u.max(v))) {
println!("No");
return;
}
}
println!("Yes");
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - Marking |
| User | bouzuya |
| Language | Rust (1.42.0) |
| Score | 7 |
| Code Size | 565 Byte |
| Status | AC |
| Exec Time | 49 ms |
| Memory | 14288 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 7 / 7 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt, example3.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, example0.txt, example1.txt, example2.txt, example3.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 7 ms | 2064 KiB |
| 001.txt | AC | 27 ms | 7756 KiB |
| 002.txt | AC | 26 ms | 7584 KiB |
| 003.txt | AC | 29 ms | 7772 KiB |
| 004.txt | AC | 4 ms | 2064 KiB |
| 005.txt | AC | 21 ms | 5832 KiB |
| 006.txt | AC | 41 ms | 13128 KiB |
| 007.txt | AC | 41 ms | 13264 KiB |
| 008.txt | AC | 38 ms | 13216 KiB |
| 009.txt | AC | 31 ms | 10120 KiB |
| 010.txt | AC | 48 ms | 14216 KiB |
| 011.txt | AC | 47 ms | 14288 KiB |
| 012.txt | AC | 46 ms | 14224 KiB |
| 013.txt | AC | 32 ms | 9512 KiB |
| 014.txt | AC | 44 ms | 14128 KiB |
| 015.txt | AC | 23 ms | 6408 KiB |
| 016.txt | AC | 21 ms | 6020 KiB |
| 017.txt | AC | 19 ms | 6560 KiB |
| 018.txt | AC | 36 ms | 10936 KiB |
| 019.txt | AC | 31 ms | 8672 KiB |
| 020.txt | AC | 32 ms | 9464 KiB |
| 021.txt | AC | 46 ms | 14260 KiB |
| 022.txt | AC | 46 ms | 14284 KiB |
| 023.txt | AC | 46 ms | 14276 KiB |
| 024.txt | AC | 47 ms | 14200 KiB |
| 025.txt | AC | 44 ms | 14212 KiB |
| 026.txt | AC | 49 ms | 14200 KiB |
| example0.txt | AC | 2 ms | 2068 KiB |
| example1.txt | AC | 1 ms | 2104 KiB |
| example2.txt | AC | 2 ms | 2136 KiB |
| example3.txt | AC | 3 ms | 2036 KiB |