結果

問題 No.2765 Cross Product
ユーザー tentententen
提出日時 2024-06-04 13:19:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 1,491 bytes
コンパイル時間 6,010 ms
コンパイル使用メモリ 87,940 KB
実行使用メモリ 38,168 KB
最終ジャッジ日時 2024-06-04 13:19:27
合計ジャッジ時間 9,558 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
38,160 KB
testcase_01 AC 101 ms
37,716 KB
testcase_02 AC 83 ms
38,072 KB
testcase_03 AC 66 ms
37,824 KB
testcase_04 AC 70 ms
38,112 KB
testcase_05 AC 66 ms
37,916 KB
testcase_06 AC 66 ms
38,040 KB
testcase_07 AC 69 ms
38,032 KB
testcase_08 AC 69 ms
37,816 KB
testcase_09 AC 66 ms
37,676 KB
testcase_10 AC 67 ms
37,788 KB
testcase_11 AC 68 ms
37,756 KB
testcase_12 AC 67 ms
37,952 KB
testcase_13 AC 69 ms
38,160 KB
testcase_14 AC 69 ms
37,980 KB
testcase_15 AC 70 ms
37,832 KB
testcase_16 AC 68 ms
38,144 KB
testcase_17 AC 74 ms
37,972 KB
testcase_18 AC 68 ms
38,096 KB
testcase_19 AC 64 ms
37,528 KB
testcase_20 AC 67 ms
37,832 KB
testcase_21 AC 67 ms
37,856 KB
testcase_22 AC 68 ms
37,940 KB
testcase_23 AC 70 ms
38,024 KB
testcase_24 AC 68 ms
38,168 KB
testcase_25 AC 67 ms
37,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int[] a = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int[] b = new int[]{sc.nextInt(), sc.nextInt(), sc.nextInt()};
        int[] ans = new int[3];
        for (int i = 0; i < 3; i++) {
            ans[i] = a[(i + 1) % 3] * b[(i + 2) % 3] - a[(i + 2) % 3] * b[(i + 1) % 3];
        }
        System.out.println(Arrays.stream(ans).mapToObj(String::valueOf).collect(Collectors.joining(" ")));
    }
}
class Scanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
        } catch (Exception e) {
            
        }
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    
    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    
    public String next() {
        try {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return st.nextToken();
        }
    }
    
}
0