結果

問題 No.73 helloworld
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-20 01:19:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,187 bytes
コンパイル時間 4,098 ms
コンパイル使用メモリ 73,420 KB
実行使用メモリ 56,368 KB
最終ジャッジ日時 2023-09-17 22:30:55
合計ジャッジ時間 6,776 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 125 ms
55,864 KB
testcase_02 AC 124 ms
55,728 KB
testcase_03 RE -
testcase_04 AC 126 ms
55,988 KB
testcase_05 WA -
testcase_06 AC 126 ms
56,012 KB
testcase_07 WA -
testcase_08 AC 125 ms
55,908 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 125 ms
56,172 KB
testcase_13 AC 126 ms
56,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int[] n = new int[26];
        for(int i=0; i<26; i++){
            n[i]=koko.nextInt();
        }
        int dn = n[3];
        int en = n[4];
        int hn = n[7];
        int ln = n[11];
        int on = n[14];
        int rn = n[17];
        int wn = n[22];
        int o = 0;
        if(on%2==0){
            o=(on/2)*(on/2);
        }else{
            o=(on+1)*(on-1)/4;
        }
        long l=0;
        if(ln%3==0){
            if(ln>=3){
                l=1;
            }
            for(int i=1; i<ln/3; i++){
                l=l*(i+1)*(i+1)*(2*i+1)/(i*i*(2*i-1));
            }
        }else{
            if(ln>3){
                l=1;
            }
            int ama = ln%3;
            int a=(ln-ama)/3;
            for(int i=1; i<a; i++){
                l=l*(i+1)*2*(i+1)*(2*i+1)/(i*2*i*(2*i-1));
            }
            int b = 1+(ln-3-ama)*2/3;
            for(int i=0; i<ama; i++){
                l=l*(b+2+i)/(b+i);
            }
        }
        System.out.println(dn*en*hn*rn*wn*o*l);
    }
    
}
0