結果
問題 | No.1816 MUL-DIV Game |
ユーザー |
![]() |
提出日時 | 2022-01-21 21:46:30 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 579 bytes |
コンパイル時間 | 6,034 ms |
コンパイル使用メモリ | 74,940 KB |
実行使用メモリ | 61,424 KB |
最終ジャッジ日時 | 2024-11-25 23:25:43 |
合計ジャッジ時間 | 10,673 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 15 |
ソースコード
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); } }