結果

問題 No.73 helloworld
ユーザー holegumaholeguma
提出日時 2015-08-14 10:52:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 902 bytes
コンパイル時間 1,966 ms
コンパイル使用メモリ 74,192 KB
実行使用メモリ 49,596 KB
最終ジャッジ日時 2023-09-11 12:04:48
合計ジャッジ時間 3,402 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,412 KB
testcase_01 AC 43 ms
49,364 KB
testcase_02 AC 43 ms
47,360 KB
testcase_03 AC 43 ms
49,212 KB
testcase_04 AC 43 ms
49,548 KB
testcase_05 AC 43 ms
49,596 KB
testcase_06 AC 43 ms
49,364 KB
testcase_07 AC 43 ms
49,348 KB
testcase_08 AC 43 ms
49,264 KB
testcase_09 AC 44 ms
49,372 KB
testcase_10 AC 44 ms
49,272 KB
testcase_11 AC 43 ms
49,364 KB
testcase_12 AC 42 ms
49,472 KB
testcase_13 AC 43 ms
49,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] arg) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int[] a=new int[27];
for(int i=1;i<=26;i++) a[i]=Integer.parseInt(br.readLine());
int d=a[4];
int e=a[5];
int h=a[8];
int l=a[12];
int o=a[15];
int r=a[18];
int w=a[23];
int o1=o/2;
o=o1*(o-o1);
long l1=0;
if(l>=3){
int t=(int)((l+1+Math.sqrt(l*(l-1)-1))/3);
l1=Math.max(l1,l-2);
l1=Math.max(l1,combination(t,2)*(l-t));
l1=Math.max(l1,combination(t+1,2)*(l-t-1));
}
else l1=0;
out.println(d*e*h*l1*o*r*w);
out.flush();
}

private static long combination(int a,int b){
if(b==0||b==a) return 1;
if(b==a-1||b==1) return a;
if(a/2>=b) return fact(a,a-b+1)/fact(b,1);
else return combination(a,a-b);
}

private static long fact(int a,int b){
if(a==b) return b;
return a*fact(a-1,b);
}
}
0