Submission #33047210


Source Code Expand

Copy
use proconio::{input, marker::Usize1};
fn main() {
input! {
n: usize,
mut l: [usize; n],
};
l.sort();
let mut count = 0_usize;
for i in 0..n {
for j in i + 1..n {
for k in j + 1..n {
if l[i] == l[j] || l[i] == l[k] || l[j] == l[k] {
continue;
}
if l[i] + l[j] > l[k] {
count += 1;
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
use proconio::{input, marker::Usize1};

fn main() {
    input! {
        n: usize,
        mut l: [usize; n],
    };
    l.sort();
    let mut count = 0_usize;
    for i in 0..n {
        for j in i + 1..n {
            for k in j + 1..n {
                if l[i] == l[j] || l[i] == l[k] || l[j] == l[k] {
                    continue;
                }

                if l[i] + l[j] > l[k] {
                    count += 1;
                }
            }
        }
    }
    let ans = count;
    println!("{}", ans);
}

Submission Info

Submission Time
Task B - Making Triangle
User bouzuya
Language Rust (1.42.0)
Score 200
Code Size 523 Byte
Status AC
Exec Time 7 ms
Memory 2176 KB

Compile Error

warning: unused import: `marker::Usize1`
 --> src/main.rs:1:23
  |
1 | use proconio::{input, marker::Usize1};
  |                       ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 23
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt, s4.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, s1.txt, s2.txt, s3.txt, s4.txt
Case Name Status Exec Time Memory
01.txt AC 7 ms 2060 KB
02.txt AC 2 ms 2072 KB
03.txt AC 2 ms 2080 KB
04.txt AC 2 ms 2124 KB
05.txt AC 1 ms 2132 KB
06.txt AC 2 ms 1980 KB
07.txt AC 2 ms 1980 KB
08.txt AC 2 ms 2044 KB
09.txt AC 2 ms 1948 KB
10.txt AC 2 ms 2120 KB
11.txt AC 2 ms 2112 KB
12.txt AC 1 ms 2136 KB
13.txt AC 2 ms 2112 KB
14.txt AC 2 ms 2120 KB
15.txt AC 1 ms 2072 KB
16.txt AC 2 ms 2096 KB
17.txt AC 2 ms 2176 KB
18.txt AC 2 ms 2056 KB
19.txt AC 2 ms 2120 KB
s1.txt AC 2 ms 2004 KB
s2.txt AC 2 ms 2004 KB
s3.txt AC 1 ms 2132 KB
s4.txt AC 2 ms 2036 KB


2025-04-09 (Wed)
07:03:29 +00:00