結果

問題 No.73 helloworld
ユーザー ぴろず
提出日時 2014-12-11 15:04:52
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 1,687 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 54,020 KB
最終ジャッジ日時 2024-06-11 20:35:07
合計ジャッジ時間 4,008 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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 *= 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