結果

問題 No.33 アメーバがたくさん
ユーザー mitsuomitsuo
提出日時 2016-05-08 00:20:04
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,747 bytes
コンパイル時間 1,994 ms
コンパイル使用メモリ 78,740 KB
実行使用メモリ 326,880 KB
最終ジャッジ日時 2023-10-24 20:17:47
合計ジャッジ時間 5,485 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package jp.fedom.challange.yuki.l3.q33;

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> input = new ArrayList<>();
		while (sc.hasNext()) {
			input.add(sc.nextLine());
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static int solve2(List<String> in) {
//		int N = Integer.valueOf(in.get(0).split(" ")[0]);
//		int D = Integer.valueOf(in.get(0).split(" ")[1]);
//		int T = Integer.valueOf(in.get(0).split(" ")[2]);
//		int[] X = new int[N];
//		String[] s = in.get(1).split(" ");
//		for (int i = 0; i < N; i++) {
//			X[i] = Integer.valueOf(s[i]);
//		}
//
//		long[][] min = new long[N][];
//		long[][] max = new long[N][];
//		for (int i = 0; i < N; i++) {
//			min[i] = new long[N];
//			max[i] = new long[N];
//		}
//		for (int i = 0; i < N; i++) {
//			for (int j = 0; j < N; j++) {
//				long d = Math.abs(X[i] - X[j]);
//				if (d % D == 0) {
//					min[i][j] = Math.max(X[i] - D * T, X[j] + D * T);
//					max[i][j] = Math.min(X[i] + D * T, X[j] - D * T);
//				}
//			}
//		}

		return 1; // f.bitCount();
	}

	public static int solve(List<String> in) {
		int N = Integer.valueOf(in.get(0).split(" ")[0]);
		int D = Integer.valueOf(in.get(0).split(" ")[1]);
		int T = Integer.valueOf(in.get(0).split(" ")[2]);
		String[] X = in.get(1).split(" ");

		BigInteger f = BigInteger.ZERO;
		for (String s : X) {
			int i = Integer.valueOf(s);
			f = f.flipBit(i + Integer.MAX_VALUE);
		}

		for (int i = 0; i < T; i++) {
			BigInteger l = f.shiftLeft(D);
			BigInteger r = f.shiftRight(D);

			f = f.or(l).or(r);
		}

		return f.bitCount();
	}
}
0