Submission #61559449
Source Code Expand
use std::collections::BTreeSet;
use proconio::{input, marker::Chars};
pub fn main() {
input! {
n: usize,
an: [usize; n]
};
let mut ans = 0;
for i in 0..n {
let j = an[i..].partition_point(|x| x / 2 < an[i]);
ans += n - i - j;
}
println!("{}", ans);
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Various Kagamimochi |
| User | macaroon |
| Language | Rust (rustc 1.70.0) |
| Score | 300 |
| Code Size | 327 Byte |
| Status | AC |
| Exec Time | 32 ms |
| Memory | 10584 KiB |
Compile Error
warning: unused import: `std::collections::BTreeSet`
--> src/main.rs:1:5
|
1 | use std::collections::BTreeSet;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `marker::Chars`
--> src/main.rs:3:23
|
3 | use proconio::{input, marker::Chars};
| ^^^^^^^^^^^^^
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| 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_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 02_handmade_23.txt, 02_handmade_24.txt, 02_handmade_25.txt, 02_handmade_26.txt, 02_handmade_27.txt, 02_handmade_28.txt, 02_handmade_29.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 0 ms | 1868 KiB |
| 00_sample_01.txt | AC | 0 ms | 2068 KiB |
| 00_sample_02.txt | AC | 0 ms | 1972 KiB |
| 01_random_03.txt | AC | 32 ms | 10512 KiB |
| 01_random_04.txt | AC | 32 ms | 10584 KiB |
| 01_random_05.txt | AC | 32 ms | 10428 KiB |
| 01_random_06.txt | AC | 32 ms | 10360 KiB |
| 01_random_07.txt | AC | 31 ms | 10584 KiB |
| 01_random_08.txt | AC | 32 ms | 10512 KiB |
| 01_random_09.txt | AC | 32 ms | 10484 KiB |
| 01_random_10.txt | AC | 17 ms | 6312 KiB |
| 01_random_11.txt | AC | 10 ms | 4484 KiB |
| 01_random_12.txt | AC | 5 ms | 3268 KiB |
| 01_random_13.txt | AC | 30 ms | 8268 KiB |
| 01_random_14.txt | AC | 30 ms | 8276 KiB |
| 01_random_15.txt | AC | 30 ms | 8328 KiB |
| 01_random_16.txt | AC | 32 ms | 9304 KiB |
| 01_random_17.txt | AC | 31 ms | 9032 KiB |
| 01_random_18.txt | AC | 32 ms | 9196 KiB |
| 01_random_19.txt | AC | 0 ms | 1856 KiB |
| 01_random_20.txt | AC | 0 ms | 1936 KiB |
| 01_random_21.txt | AC | 0 ms | 2060 KiB |
| 01_random_22.txt | AC | 0 ms | 1904 KiB |
| 02_handmade_23.txt | AC | 28 ms | 8616 KiB |
| 02_handmade_24.txt | AC | 9 ms | 4372 KiB |
| 02_handmade_25.txt | AC | 22 ms | 7252 KiB |
| 02_handmade_26.txt | AC | 3 ms | 2492 KiB |
| 02_handmade_27.txt | AC | 29 ms | 8976 KiB |
| 02_handmade_28.txt | AC | 26 ms | 10576 KiB |
| 02_handmade_29.txt | AC | 16 ms | 6672 KiB |