結果

問題 No.73 helloworld
ユーザー 37zigen37zigen
提出日時 2016-05-04 15:35:34
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,356 bytes
コンパイル時間 2,326 ms
コンパイル使用メモリ 77,648 KB
実行使用メモリ 55,904 KB
最終ジャッジ日時 2024-04-15 11:18:00
合計ジャッジ時間 5,249 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 144 ms
41,712 KB
testcase_02 AC 143 ms
41,496 KB
testcase_03 AC 146 ms
41,432 KB
testcase_04 AC 144 ms
41,428 KB
testcase_05 WA -
testcase_06 AC 146 ms
41,280 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 143 ms
42,100 KB
testcase_13 AC 139 ms
41,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.Scanner;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		String s="abcdefghijklmnopqrstuvwxyz";
		int 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);
		int x=(int)((l+1+Math.sqrt(l*l-l+1))/3.0);
		int o1=o/2;int 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"));
	}
	//階乗
	long fact(int n){
		long ans=1;
		for(int i=1;i<=n;i++)ans*=i;
		return ans;
	}
	//1~nの数字からk個取る方法の数
	long nCk(int n,int k){
		if(n<k)return 0;
		else{
			return (fact(n)/(fact(n-k)*fact(k)));
		}
	}

}
0