結果

問題 No.73 helloworld
ユーザー kou6839kou6839
提出日時 2014-12-02 20:46:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 1,317 bytes
コンパイル時間 2,573 ms
コンパイル使用メモリ 73,968 KB
実行使用メモリ 56,096 KB
最終ジャッジ日時 2023-09-11 07:32:06
合計ジャッジ時間 4,938 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,564 KB
testcase_01 AC 124 ms
55,796 KB
testcase_02 AC 125 ms
55,516 KB
testcase_03 AC 125 ms
55,864 KB
testcase_04 AC 124 ms
56,040 KB
testcase_05 AC 128 ms
55,648 KB
testcase_06 AC 123 ms
55,796 KB
testcase_07 AC 122 ms
55,996 KB
testcase_08 AC 126 ms
55,556 KB
testcase_09 AC 123 ms
55,576 KB
testcase_10 AC 123 ms
55,440 KB
testcase_11 AC 126 ms
56,096 KB
testcase_12 AC 125 ms
55,804 KB
testcase_13 AC 124 ms
55,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] al = new int[26];
        for(int i=0;i<26;i++){
        	al[i]=sc.nextInt();
        }
        long ans=1;
        if(al[3]<1){
        	System.out.println(0);
        	return;
        }
        ans*=al[3];
        if(al[4]<1){
        	System.out.println(0);
        	return;
        }
        ans*=al[4];
        if(al[7]<1){
        	System.out.println(0);
        	return;
        }
        ans*=al[7];
        if(al[11]<3){
        	System.out.println(0);
        	return;
        }
        int temp1=1;
        for(int i=2;i<al[11];i++){
        	temp1=Math.max(temp1, i*(i-1)/2*(al[11]-i));
        }
        ans*=temp1;
        if(al[14]<2){
        	System.out.println(0);
        	return;
        }
        int temp2=1;
        for(int i=1;i<al[14];i++){
        	temp2=Math.max(temp2, i*(al[14]-i));
        }
        ans*=temp2;
        if(al[17]<1){
        	System.out.println(0);
        	return;
        }
        ans*=al[17];
        if(al[22]<1){
        	System.out.println(0);
        	return;
        }
        ans*=al[22];
        System.out.println(ans);
    }
}
0