結果

問題 No.1816 MUL-DIV Game
ユーザー merlinmerlin
提出日時 2022-01-21 22:04:05
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 2,459 ms
コンパイル使用メモリ 75,036 KB
実行使用メモリ 49,772 KB
最終ジャッジ日時 2024-11-26 00:13:42
合計ジャッジ時間 7,824 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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