Submission #45991888
Source Code Expand
use std::collections::HashSet;
use proconio::input;
fn main() {
input! {
n: usize,
a: [usize; n],
};
let mut set = HashSet::new();
for i in 0..n {
for j in i + 1..n {
for k in j + 1..n {
set.insert(a[i] * a[j] * a[k]);
}
}
}
let ans = set.len();
println!("{}", ans);
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Triplet Product |
| User | bouzuya |
| Language | Rust (rustc 1.70.0) |
| Score | 8 |
| Code Size | 371 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 2528 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 8 / 8 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt |
| All | example_00.txt, example_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 1 ms | 1872 KiB |
| example_01.txt | AC | 1 ms | 1980 KiB |
| test_00.txt | AC | 3 ms | 1908 KiB |
| test_01.txt | AC | 1 ms | 1932 KiB |
| test_02.txt | AC | 1 ms | 1836 KiB |
| test_03.txt | AC | 1 ms | 2044 KiB |
| test_04.txt | AC | 3 ms | 2424 KiB |
| test_05.txt | AC | 2 ms | 2280 KiB |
| test_06.txt | AC | 2 ms | 2192 KiB |
| test_07.txt | AC | 1 ms | 2072 KiB |
| test_08.txt | AC | 1 ms | 1868 KiB |
| test_09.txt | AC | 3 ms | 2324 KiB |
| test_10.txt | AC | 4 ms | 2448 KiB |
| test_11.txt | AC | 2 ms | 2528 KiB |