Skip to content

Commit da78cd5

Browse files
committed
Add a test for ABC121-B
1 parent 39026b7 commit da78cd5

File tree

8 files changed

+42
-0
lines changed

8 files changed

+42
-0
lines changed

examples/abc121-b.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// https://atcoder.jp/contests/abc121/tasks/abc121_b
2+
3+
use proconio::input;
4+
5+
fn main() {
6+
input! {
7+
n: usize,
8+
m: usize,
9+
c: i32,
10+
b: [i32; m],
11+
a: [[i32; m]; n],
12+
}
13+
14+
let ans = a
15+
.into_iter()
16+
.filter(|a| a.iter().zip(&b).map(|(a, b)| a * b).sum::<i32>() + c > 0)
17+
.count();
18+
println!("{}", ans);
19+
}

examples/tests.ron

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
name: "ABC120: D - Decayed Bridges",
5656
matching: Words,
5757
),
58+
"abc121-b": (
59+
name: "ABC121: B - Can you solve this?",
60+
matching: Words,
61+
),
5862
"abc129-f": (
5963
name: "ABC129: F - Takahashi's Basics in Education and Learning",
6064
matching: Words,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2 3 -10
2+
1 2 3
3+
3 2 1
4+
1 2 2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
5 2 -4
2+
-2 5
3+
100 41
4+
100 40
5+
-3 0
6+
-6 -2
7+
18 -13
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
3 3 0
2+
100 -100 0
3+
0 100 100
4+
100 100 100
5+
-100 100 100
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

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