Type: Default 1000ms 256MiB

正交性

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给定两个NN维向量 $A\ =\ (A_1,\ A_2,\ A_3,\ \dots,\ A_N),\ B\ =\ (B_1,\ B_2,\ B_3,\ \dots,\ B_N)$

判断 A A B B 的内积是否为 0。

换句话说,判断 $A_1B_1\ +\ A_2B_2\ +\ A_3B_3\ +\ \dots\ +\ A_NB_N\ =\ 0$ 。

输入格式

第一行输入 NN

第二行输入 A1,A2,,ANA_1,A_2,\cdots,A_N

蒂三行输入 B1,B2,,BNB_1,B_2,\cdots,B_N

输出格式

如果 AABB 的内积为 00,输出 Yes;否则,输出 No

2
-3 6
4 2
Yes
2
4 5
-1 -3
No
3
1 3 5
3 -6 3
Yes

提示

数据范围

  • 1  N  100000 1\ \le\ N\ \le\ 100000
  • 100  Ai  100 -100\ \le\ A_i\ \le\ 100
  • 100  Bi  100 -100\ \le\ B_i\ \le\ 100
  • 所有输入值均为整数

样例说明 1

A A B B 的内积为 (3) × 4 + 6 × 2 = 0 (-3)\ \times\ 4\ +\ 6\ \times\ 2\ =\ 0

样例说明 2

A A B B 的内积为 4 × (1) + 5 × (3) = 19 4\ \times\ (-1)\ +\ 5\ \times\ (-3)\ =\ -19

样例说明 3

A A B B 的内积为 $1\ \times\ 3\ +\ 3\ \times\ (-6)\ +\ 5\ \times\ 3\ =\ 0$ 。

季科_周六早上

Not Claimed
Status
Done
Problem
13
Open Since
2025-3-21 0:00
Deadline
2026-2-19 23:59
Extension
24 hour(s)