結果

問題 No.550 夏休みの思い出(1)
ユーザー 37zigen37zigen
提出日時 2017-07-29 17:01:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,024 bytes
コンパイル時間 2,308 ms
コンパイル使用メモリ 83,380 KB
実行使用メモリ 54,748 KB
最終ジャッジ日時 2024-04-19 02:44:14
合計ジャッジ時間 12,528 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 154 ms
42,112 KB
testcase_02 AC 157 ms
42,168 KB
testcase_03 AC 155 ms
41,712 KB
testcase_04 AC 151 ms
41,812 KB
testcase_05 AC 153 ms
41,612 KB
testcase_06 AC 152 ms
41,864 KB
testcase_07 AC 141 ms
42,044 KB
testcase_08 AC 145 ms
42,024 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 144 ms
42,160 KB
testcase_23 AC 155 ms
41,832 KB
testcase_24 AC 154 ms
41,632 KB
testcase_25 AC 152 ms
42,044 KB
testcase_26 AC 137 ms
41,932 KB
testcase_27 AC 155 ms
42,308 KB
testcase_28 AC 152 ms
41,852 KB
testcase_29 AC 152 ms
41,888 KB
testcase_30 AC 140 ms
41,592 KB
testcase_31 AC 149 ms
41,704 KB
testcase_32 AC 153 ms
41,768 KB
testcase_33 AC 143 ms
42,020 KB
testcase_34 AC 155 ms
41,416 KB
testcase_35 AC 153 ms
41,700 KB
testcase_36 AC 153 ms
41,780 KB
testcase_37 AC 142 ms
42,284 KB
testcase_38 AC 155 ms
42,420 KB
testcase_39 AC 155 ms
41,580 KB
testcase_40 AC 161 ms
41,772 KB
testcase_41 AC 154 ms
42,088 KB
testcase_42 AC 152 ms
41,980 KB
testcase_43 AC 151 ms
42,056 KB
testcase_44 AC 152 ms
41,912 KB
testcase_45 AC 153 ms
41,680 KB
testcase_46 AC 151 ms
41,960 KB
testcase_47 AC 154 ms
41,636 KB
testcase_48 AC 137 ms
41,756 KB
testcase_49 AC 152 ms
41,452 KB
testcase_50 AC 155 ms
41,856 KB
testcase_51 AC 153 ms
41,848 KB
testcase_52 AC 160 ms
42,112 KB
testcase_53 AC 155 ms
41,720 KB
testcase_54 AC 154 ms
42,100 KB
testcase_55 AC 150 ms
42,332 KB
testcase_56 AC 152 ms
42,168 KB
testcase_57 AC 156 ms
41,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
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 = Long.valueOf(BigInteger.valueOf(3_000_0).nextProbablePrime().toString());
		ArrayList<Long> ans = new ArrayList<>();
		for (long i = 0; i <MOD; ++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