結果

問題 No.73 helloworld
ユーザー tsunabittsunabit
提出日時 2020-01-07 15:02:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 774 bytes
コンパイル時間 3,918 ms
コンパイル使用メモリ 78,160 KB
実行使用メモリ 41,260 KB
最終ジャッジ日時 2024-05-02 11:33:39
合計ジャッジ時間 6,941 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
40,984 KB
testcase_01 AC 136 ms
41,204 KB
testcase_02 AC 137 ms
41,260 KB
testcase_03 AC 138 ms
41,204 KB
testcase_04 AC 134 ms
40,880 KB
testcase_05 AC 132 ms
41,204 KB
testcase_06 AC 132 ms
40,996 KB
testcase_07 AC 129 ms
41,084 KB
testcase_08 AC 130 ms
40,808 KB
testcase_09 AC 139 ms
41,028 KB
testcase_10 AC 138 ms
41,052 KB
testcase_11 AC 143 ms
41,212 KB
testcase_12 AC 122 ms
39,640 KB
testcase_13 AC 132 ms
40,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No73 {
//	private static Set<String> set = new HashSet<String>();
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[26];
		long total = 0;
		for(int i = 0; i < 26; i++) {
			a[i] = sc.nextInt();
		}
		// この問題は部分文字列
		// lとo以外の文字
		total = (long)a[3]*a[4]*a[7]*a[17]*a[22];
		// lの最大
		long maxl = 0;
		for(int i = 2; i < a[11]; i++) {
			long tmp = i * (i - 1) / 2 * (a[11] - i);
			maxl = Math.max(maxl, tmp);
		}
		// oの最大
		long maxo = 0;
		for(int i = 1; i < a[14]; i++) {
			long tmp = i * (a[14] - i);
			maxo = Math.max(maxo, tmp);
		}
		total = total * maxl * maxo;
		System.out.println(total);
	}
}
0