No.2765 Cross Product
問題文最終更新日: 2024-05-24 15:44:58
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 431
(順位表)
の他の問題:
Problem Statement
You are given 3-dimensional vectors $A=(A_x, A_y, A_z), B=(B_x, B_y, B_z)$.
Find the cross product $C=A\times B$ of $A$ and $B$.
Here, $A\times B = (A_yB_z-A_zB_y, A_zB_x-A_xB_z, A_xB_y-A_yB_x)$.
Input
$A_x\ A_y\ A_z$ $B_x\ B_y\ B_z$
Output
Letting $C=(C_x, C_y, C_z)$, print $C_x, C_y, C_z$ in this order, separated by single-byte spaces.
Print a newline at the end.
Sample
Sample 1
Input
3 1 4 2 7 1
Output
-27 5 19
We have $C_x=A_yB_z-A_zB_y=1\times 1-4\times 7=-27,C_y=A_zB_x-A_xB_z=4\times 2-3\times 1=5,C_z=A_xB_y-A_yB_x=3\times 7-1\times 2=19$.
Sample 2
Input
314 159 265 271 828 182
Output
-190482 14667 216903
Sample 3
Input
27 -1828 1828 -45 90 -45
Output
-82260 -81045 -79830
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。