結果

問題 No.73 helloworld
ユーザー 37zigen37zigen
提出日時 2016-05-04 15:36:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 1,129 bytes
コンパイル時間 3,410 ms
コンパイル使用メモリ 79,320 KB
実行使用メモリ 56,356 KB
最終ジャッジ日時 2023-09-12 00:33:01
合計ジャッジ時間 5,959 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,760 KB
testcase_01 AC 126 ms
55,664 KB
testcase_02 AC 125 ms
56,076 KB
testcase_03 AC 122 ms
55,868 KB
testcase_04 AC 122 ms
55,828 KB
testcase_05 AC 124 ms
56,172 KB
testcase_06 AC 124 ms
56,160 KB
testcase_07 AC 124 ms
55,620 KB
testcase_08 AC 123 ms
56,356 KB
testcase_09 AC 124 ms
55,688 KB
testcase_10 AC 124 ms
55,872 KB
testcase_11 AC 125 ms
55,844 KB
testcase_12 AC 126 ms
56,036 KB
testcase_13 AC 125 ms
55,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.Scanner;
public class Q073 {
	public static void main(String[] args)throws Exception{
		new Q073().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		String s="abcdefghijklmnopqrstuvwxyz";
		long h=0,e=0,l=0,o=0,w=0,r=0,d=0;
		for(int i=0;i<26;i++){
			int a=sc.nextInt();
			if(i==7)h=a;
			else if(i==s.indexOf("e"))e=a;
			else if(i==s.indexOf("l"))l=a;
			else if(i==s.indexOf("o"))o=a;
			else if(i==s.indexOf("w"))w=a;
			else if(i==s.indexOf("r"))r=a;
			else if(i==s.indexOf("l"))l=a;
			else if(i==s.indexOf("d"))d=a;
		}
//		System.out.println(h+" "+e+" "+l+" "+o+" "+w+" "+r+" "+d);
		long x=(long)((l+1+Math.sqrt(l*l-l+1))/3.0);
		long o1=o/2;long o2=o-o1;o=0;
		long ans=Math.max(h*e*w*r*(l-x)*d*o1*o2*x*(x-1)/2, h*e*w*r*(l-x-1)*d*o1*o2*(x+1)*x/2);
		System.out.println(ans);		
//		System.out.println(s.indexOf("h"));
//		System.out.println(s.indexOf("e"));
//		System.out.println(s.indexOf("l"));
//		System.out.println(s.indexOf("o"));
//		System.out.println(s.indexOf("w"));
//		System.out.println(s.indexOf("r"));
//		System.out.println(s.indexOf("d"));
	}


}
0