結果

問題 No.73 helloworld
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-20 01:25:58
言語 Java19
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 1,236 bytes
コンパイル時間 2,606 ms
コンパイル使用メモリ 74,572 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-09-11 11:06:00
合計ジャッジ時間 5,196 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,988 KB
testcase_01 AC 126 ms
56,128 KB
testcase_02 AC 125 ms
56,072 KB
testcase_03 AC 124 ms
55,724 KB
testcase_04 AC 123 ms
55,988 KB
testcase_05 AC 121 ms
55,816 KB
testcase_06 AC 123 ms
55,812 KB
testcase_07 AC 122 ms
55,824 KB
testcase_08 AC 124 ms
55,800 KB
testcase_09 AC 122 ms
55,792 KB
testcase_10 AC 122 ms
55,804 KB
testcase_11 AC 124 ms
55,736 KB
testcase_12 AC 124 ms
56,056 KB
testcase_13 AC 125 ms
55,744 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((long)dn*en*hn*rn*wn*o*l);
    }
}
0