結果

問題 No.73 helloworld
ユーザー ぴろずぴろず
提出日時 2014-12-11 15:12:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 577 bytes
コンパイル時間 2,910 ms
コンパイル使用メモリ 70,980 KB
実行使用メモリ 55,996 KB
最終ジャッジ日時 2023-09-11 07:33:54
合計ジャッジ時間 4,913 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,688 KB
testcase_01 AC 126 ms
55,996 KB
testcase_02 AC 129 ms
55,404 KB
testcase_03 AC 129 ms
55,740 KB
testcase_04 AC 128 ms
55,636 KB
testcase_05 AC 128 ms
55,880 KB
testcase_06 AC 130 ms
55,668 KB
testcase_07 AC 127 ms
55,668 KB
testcase_08 AC 127 ms
55,788 KB
testcase_09 AC 131 ms
55,588 KB
testcase_10 AC 128 ms
55,852 KB
testcase_11 AC 129 ms
55,588 KB
testcase_12 AC 130 ms
55,848 KB
testcase_13 AC 129 ms
55,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no073;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] c = new int[128];
		for(int i=0;i<26;i++) {
			c[i + 'a'] = sc.nextInt();
		}
		long num = 1;
		num *= (long) c['h'] * c['e'] * c['w'] * c['r'] * c['d'];
		int o = c['o'];
		num *= (o/2) * (o-o/2);
		int l = c['l'];
		if (l == 0) {
			num = 0;
		}else{
			long max = 0;
			for(int i=1;i<l;i++) {
				max = Math.max(max,i*(i-1)/2*(l-i));
			}
			num *= max;
		}
		System.out.println(num);
	}

}
0