結果

問題 No.1816 MUL-DIV Game
ユーザー merlinmerlin
提出日時 2022-01-21 22:04:05
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 75,624 KB
実行使用メモリ 63,168 KB
最終ジャッジ日時 2024-05-04 13:00:51
合計ジャッジ時間 6,980 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
36,952 KB
testcase_01 AC 47 ms
36,900 KB
testcase_02 AC 49 ms
37,204 KB
testcase_03 AC 47 ms
37,236 KB
testcase_04 AC 48 ms
37,196 KB
testcase_05 AC 50 ms
36,952 KB
testcase_06 AC 50 ms
37,200 KB
testcase_07 AC 50 ms
36,900 KB
testcase_08 AC 49 ms
36,900 KB
testcase_09 AC 106 ms
40,440 KB
testcase_10 AC 185 ms
46,420 KB
testcase_11 AC 168 ms
46,952 KB
testcase_12 AC 145 ms
45,808 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 245 ms
49,816 KB
testcase_27 WA -
testcase_28 AC 231 ms
50,028 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];
        else if(n%2==0) ans=a[n/2-1];
        System.out.println(ans);
    }
}
0