結果

問題 No.785 色食い虫
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-02-21 23:49:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 840 bytes
コンパイル時間 4,413 ms
コンパイル使用メモリ 74,204 KB
実行使用メモリ 56,412 KB
最終ジャッジ日時 2023-08-13 16:49:44
合計ジャッジ時間 8,009 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,392 KB
testcase_01 AC 116 ms
56,412 KB
testcase_02 AC 117 ms
55,472 KB
testcase_03 AC 117 ms
55,508 KB
testcase_04 AC 117 ms
55,452 KB
testcase_05 AC 117 ms
55,512 KB
testcase_06 AC 117 ms
55,472 KB
testcase_07 AC 116 ms
55,396 KB
testcase_08 AC 116 ms
55,448 KB
testcase_09 AC 116 ms
53,460 KB
testcase_10 AC 116 ms
55,472 KB
testcase_11 AC 118 ms
55,608 KB
testcase_12 AC 119 ms
55,432 KB
testcase_13 AC 116 ms
55,632 KB
testcase_14 AC 115 ms
55,412 KB
testcase_15 AC 117 ms
55,708 KB
testcase_16 AC 118 ms
55,420 KB
testcase_17 AC 117 ms
55,392 KB
testcase_18 AC 120 ms
55,728 KB
testcase_19 AC 120 ms
55,572 KB
testcase_20 AC 119 ms
55,640 KB
testcase_21 AC 118 ms
55,636 KB
testcase_22 AC 116 ms
55,588 KB
testcase_23 AC 118 ms
55,296 KB
testcase_24 AC 118 ms
55,720 KB
testcase_25 AC 118 ms
55,856 KB
testcase_26 AC 119 ms
55,416 KB
testcase_27 AC 116 ms
55,704 KB
testcase_28 AC 116 ms
55,408 KB
testcase_29 AC 117 ms
55,808 KB
testcase_30 AC 116 ms
55,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	static final int IMPOSSIBLE = -1;

	static public void main(String[]args) throws Exception {
		Scanner sc = new Scanner(System.in);
		List<Integer> list = new ArrayList<>();
		for(int i = 0; i < 3; i++) {
			String s = sc.next();
			list.add(count(s));
		}
		pirntAns(list);
	}

	static int count(String s) throws Exception {
		final String NONE = "NONE";
		if(NONE.equals(s)) return 16;

		final String SEPARATOR = ",";
		String [] arr = s.split(SEPARATOR);
		return 16 - arr.length;
	}

	static void pirntAns(List<Integer> list) throws Exception {
		long ans = 1;
		for(int tmp : list) {
			ans *= pow(tmp, 2);
		}
		System.out.println(ans);
	}

	static long pow(long l, double p) throws Exception {
		return (long) (Math.pow(l, p));
	}
}
0