結果

問題 No.1816 MUL-DIV Game
ユーザー merlinmerlin
提出日時 2022-01-21 21:46:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 2,279 ms
コンパイル使用メモリ 75,448 KB
実行使用メモリ 62,836 KB
最終ジャッジ日時 2024-05-04 12:29:10
合計ジャッジ時間 7,478 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
36,788 KB
testcase_01 AC 50 ms
37,196 KB
testcase_02 AC 51 ms
37,080 KB
testcase_03 AC 50 ms
37,364 KB
testcase_04 AC 51 ms
37,196 KB
testcase_05 AC 51 ms
37,236 KB
testcase_06 AC 51 ms
37,172 KB
testcase_07 AC 50 ms
37,188 KB
testcase_08 AC 49 ms
37,376 KB
testcase_09 AC 108 ms
40,476 KB
testcase_10 AC 201 ms
47,104 KB
testcase_11 AC 169 ms
46,896 KB
testcase_12 AC 153 ms
45,688 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 241 ms
50,064 KB
testcase_27 WA -
testcase_28 AC 254 ms
49,904 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        int i,a[]=new int[n];
        String s[]=bu.readLine().split(" ");
        for(i=0;i<n;i++)
        a[i]=Integer.parseInt(s[i]);

        Arrays.sort(a);
        long ans=1;
        if(n==1) ans=a[0];
        else if(n==2) ans=1l*a[0]*a[1];
        System.out.println(ans);
    }
}
0