結果

問題 No.550 夏休みの思い出(1)
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-20 22:40:43
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 720 bytes
コンパイル時間 4,818 ms
コンパイル使用メモリ 79,620 KB
実行使用メモリ 57,476 KB
最終ジャッジ日時 2023-10-11 13:00:33
合計ジャッジ時間 16,593 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
57,168 KB
testcase_01 AC 177 ms
57,420 KB
testcase_02 AC 175 ms
56,884 KB
testcase_03 AC 177 ms
57,184 KB
testcase_04 AC 179 ms
57,128 KB
testcase_05 AC 176 ms
56,912 KB
testcase_06 AC 175 ms
57,332 KB
testcase_07 AC 174 ms
56,848 KB
testcase_08 AC 177 ms
57,348 KB
testcase_09 AC 164 ms
57,164 KB
testcase_10 AC 165 ms
57,040 KB
testcase_11 AC 165 ms
55,120 KB
testcase_12 AC 168 ms
57,164 KB
testcase_13 AC 165 ms
57,168 KB
testcase_14 AC 167 ms
57,112 KB
testcase_15 RE -
testcase_16 AC 166 ms
57,460 KB
testcase_17 AC 167 ms
57,348 KB
testcase_18 AC 166 ms
57,236 KB
testcase_19 AC 167 ms
57,316 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 177 ms
57,140 KB
testcase_23 AC 175 ms
56,844 KB
testcase_24 AC 176 ms
57,000 KB
testcase_25 AC 175 ms
56,912 KB
testcase_26 AC 176 ms
57,064 KB
testcase_27 AC 177 ms
56,888 KB
testcase_28 AC 176 ms
57,160 KB
testcase_29 AC 175 ms
57,072 KB
testcase_30 AC 175 ms
56,840 KB
testcase_31 AC 164 ms
57,144 KB
testcase_32 AC 165 ms
56,824 KB
testcase_33 AC 164 ms
56,988 KB
testcase_34 AC 166 ms
57,216 KB
testcase_35 AC 167 ms
57,096 KB
testcase_36 AC 161 ms
57,328 KB
testcase_37 AC 161 ms
57,220 KB
testcase_38 AC 160 ms
56,988 KB
testcase_39 AC 162 ms
56,856 KB
testcase_40 AC 171 ms
57,076 KB
testcase_41 AC 169 ms
57,140 KB
testcase_42 AC 168 ms
57,408 KB
testcase_43 AC 170 ms
57,096 KB
testcase_44 AC 169 ms
57,040 KB
testcase_45 AC 168 ms
56,932 KB
testcase_46 AC 171 ms
57,312 KB
testcase_47 AC 164 ms
57,144 KB
testcase_48 AC 166 ms
56,816 KB
testcase_49 RE -
testcase_50 AC 164 ms
55,132 KB
testcase_51 AC 164 ms
57,476 KB
testcase_52 AC 168 ms
57,180 KB
testcase_53 AC 168 ms
57,060 KB
testcase_54 AC 168 ms
57,056 KB
testcase_55 AC 171 ms
57,220 KB
testcase_56 AC 173 ms
57,128 KB
testcase_57 AC 171 ms
56,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class No550 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		long absc = Math.abs(C); //cの絶対値
		long kai[] = new long[3];
		for(long i = 0;i*i*i <= absc;i++) {
			if(i*i*i + A*i*i + B*i + C == 0) {
				kai[0] = i;
				break;
			}
			if(-i*i*i + A*i*i - B*i + C == 0) {
				kai[0] = -i;
				break;
			}
		}
		long a = kai[0] + A;
		long b = -C / kai[0];
		kai[1] = ((-a + (long)Math.sqrt(a*a - 4*b))/2);
		kai[2] = ((-a - (long)Math.sqrt(a*a - 4*b))/2);
		Arrays.sort(kai);
		System.out.println(kai[0] + " " + kai[1] + " " + kai[2]);
	}
	
}
0