結果

問題 No.73 helloworld
ユーザー GrenacheGrenache
提出日時 2015-11-03 21:44:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 677 bytes
コンパイル時間 3,531 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-09-11 14:45:54
合計ジャッジ時間 5,664 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,640 KB
testcase_01 AC 119 ms
56,140 KB
testcase_02 AC 118 ms
55,748 KB
testcase_03 AC 124 ms
56,076 KB
testcase_04 AC 118 ms
56,052 KB
testcase_05 AC 116 ms
55,796 KB
testcase_06 AC 119 ms
55,764 KB
testcase_07 AC 118 ms
56,244 KB
testcase_08 AC 118 ms
55,940 KB
testcase_09 AC 121 ms
56,252 KB
testcase_10 AC 119 ms
56,120 KB
testcase_11 AC 122 ms
55,836 KB
testcase_12 AC 118 ms
56,348 KB
testcase_13 AC 117 ms
56,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder73 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long[] c = new long[26];
        for (int i = 0; i < 26; i++) {
        	c[i] = sc.nextLong();
        }

        long ret = c['h' - 'a'] * c['e' - 'a'] * c['w' - 'a'] * c['r' - 'a'] * c['d' - 'a'];
        long tmp = c['o' - 'a'] / 2;
        ret *= (c['o' - 'a'] - tmp) * tmp;

        long max = 0;
        for (long l = 1; l <= c['l' - 'a']; l++) {
        	max = Math.max(max, ret * (c['l' - 'a'] - l) * (c['l' - 'a'] - l - 1) / 2 * l);
        }

		System.out.println(max);
        
        sc.close();
    }
}
0