Skip to content

Commit d943d04

Browse files
committed
Add a test for ABC077/ARC084-C
1 parent acdfa2d commit d943d04

File tree

8 files changed

+67
-0
lines changed

8 files changed

+67
-0
lines changed

examples/arc084-c.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// https://atcoder.jp/contests/arc084/tasks/arc084_a
2+
3+
use superslice::Ext as _;
4+
5+
fn main() {
6+
// use std::io::{self, Read as _};
7+
//
8+
// let mut input = "".to_owned();
9+
// io::stdin().read_to_string(&mut input).unwrap();
10+
// let mut input = input.split_whitespace();
11+
// macro_rules! read {
12+
// ([$t:tt; $n:expr]) => {
13+
// (0..$n).map(|_| read!($t)).collect::<Vec<_>>()
14+
// };
15+
// (($($t:tt),+)) => {
16+
// ($(read!($t)),*)
17+
// };
18+
// (_1based) => {
19+
// read!(usize) - 1
20+
// };
21+
// (_bytes) => {
22+
// read!(String).into_bytes()
23+
// };
24+
// ($ty:ty) => {
25+
// input.next().unwrap().parse::<$ty>().unwrap()
26+
// };
27+
// }
28+
//
29+
// let n = read!(n);
30+
// let (mut a, b, mut c) = read!(([u32; n], [u32; n], [u32; n]));
31+
32+
use proconio::input;
33+
34+
input! {
35+
n: usize,
36+
mut a: [u32; n],
37+
b: [u32; n],
38+
mut c: [u32; n],
39+
}
40+
41+
a.sort();
42+
c.sort();
43+
let ans = b
44+
.into_iter()
45+
.map(|b| a.lower_bound(&b) * (n - c.upper_bound(&b)))
46+
.sum::<usize>();
47+
println!("{}", ans);
48+
}

examples/tests.ron

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
name: "ABC045: C - One-stroke Path",
3636
matching: ExactWords,
3737
),
38+
"arc084-c": (
39+
name: "ABC077 / ARC084: C - Snuke Festival",
40+
matching: ExactWords,
41+
),
3842
"abc084-d": (
3943
name: "ABC084: D - 2017-like Number",
4044
matching: ExactWords,

examples/testsets/arc084-c/in/s1.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2
2+
1 5
3+
2 4
4+
3 6

examples/testsets/arc084-c/in/s2.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
3
2+
1 1 1
3+
2 2 2
4+
3 3 3

examples/testsets/arc084-c/in/s3.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
6
2+
3 14 159 2 6 53
3+
58 9 79 323 84 6
4+
2643 383 2 79 50 288

examples/testsets/arc084-c/out/s1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3

examples/testsets/arc084-c/out/s2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
27

examples/testsets/arc084-c/out/s3.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
87

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy