結果

問題 No.550 夏休みの思い出(1)
ユーザー 37zigen37zigen
提出日時 2017-07-29 16:09:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 935 bytes
コンパイル時間 2,238 ms
コンパイル使用メモリ 84,608 KB
実行使用メモリ 56,476 KB
最終ジャッジ日時 2024-04-19 02:32:36
合計ジャッジ時間 12,525 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 150 ms
41,124 KB
testcase_02 AC 145 ms
41,372 KB
testcase_03 AC 152 ms
40,792 KB
testcase_04 AC 152 ms
41,056 KB
testcase_05 AC 141 ms
39,972 KB
testcase_06 AC 152 ms
41,364 KB
testcase_07 AC 147 ms
41,200 KB
testcase_08 AC 145 ms
41,160 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 145 ms
41,116 KB
testcase_23 AC 155 ms
40,956 KB
testcase_24 AC 149 ms
41,160 KB
testcase_25 AC 172 ms
40,912 KB
testcase_26 AC 147 ms
41,220 KB
testcase_27 AC 168 ms
41,252 KB
testcase_28 AC 145 ms
41,376 KB
testcase_29 AC 175 ms
41,552 KB
testcase_30 AC 142 ms
40,992 KB
testcase_31 AC 148 ms
41,476 KB
testcase_32 AC 157 ms
41,120 KB
testcase_33 AC 145 ms
41,440 KB
testcase_34 AC 216 ms
41,348 KB
testcase_35 AC 145 ms
41,172 KB
testcase_36 AC 150 ms
41,064 KB
testcase_37 AC 152 ms
41,304 KB
testcase_38 AC 164 ms
41,176 KB
testcase_39 AC 160 ms
41,460 KB
testcase_40 AC 145 ms
41,220 KB
testcase_41 AC 148 ms
41,000 KB
testcase_42 AC 149 ms
41,136 KB
testcase_43 AC 150 ms
41,424 KB
testcase_44 AC 136 ms
40,224 KB
testcase_45 AC 179 ms
41,680 KB
testcase_46 AC 173 ms
41,104 KB
testcase_47 AC 171 ms
41,248 KB
testcase_48 AC 148 ms
40,904 KB
testcase_49 AC 148 ms
41,376 KB
testcase_50 AC 160 ms
41,168 KB
testcase_51 AC 149 ms
41,012 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	static long time = 0;

	public void run() {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long c = sc.nextLong();
		long MOD = 3_000_0;
		ArrayList<Long> ans = new ArrayList<>();
		for (long i = 0; i < 3_000_0; ++i) {
			if ((i * i * i + a * i * i + b * i + c) % MOD == 0) {
				for (long j = -MOD * 4_000_0; j <= MOD * 4_000_0; j += MOD) {
					long v = j + i;
					if (v * v * v + a * v * v + b * v + c == 0) {
						ans.add(v);
					}
				}
			}
		}
		Collections.sort(ans);
		for (int i = 0; i < ans.size(); ++i) {
			System.out.print(ans.get(i) + (i == ans.size() - 1 ? "\n" : " "));
		}
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0