結果

問題 No.550 夏休みの思い出(1)
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-20 22:42:42
言語 Java19
(openjdk 21)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 722 bytes
コンパイル時間 3,905 ms
コンパイル使用メモリ 76,544 KB
実行使用メモリ 57,408 KB
最終ジャッジ日時 2023-10-11 13:03:22
合計ジャッジ時間 15,683 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
56,808 KB
testcase_01 AC 171 ms
57,116 KB
testcase_02 AC 173 ms
57,020 KB
testcase_03 AC 172 ms
57,072 KB
testcase_04 AC 170 ms
57,376 KB
testcase_05 AC 171 ms
56,752 KB
testcase_06 AC 170 ms
57,100 KB
testcase_07 AC 171 ms
56,804 KB
testcase_08 AC 173 ms
57,080 KB
testcase_09 AC 160 ms
56,960 KB
testcase_10 AC 160 ms
57,096 KB
testcase_11 AC 159 ms
56,764 KB
testcase_12 AC 160 ms
57,108 KB
testcase_13 AC 162 ms
57,352 KB
testcase_14 AC 161 ms
56,828 KB
testcase_15 AC 161 ms
57,088 KB
testcase_16 AC 162 ms
56,776 KB
testcase_17 AC 162 ms
56,936 KB
testcase_18 AC 164 ms
57,132 KB
testcase_19 AC 161 ms
56,780 KB
testcase_20 AC 161 ms
57,032 KB
testcase_21 AC 163 ms
57,000 KB
testcase_22 AC 171 ms
57,372 KB
testcase_23 AC 172 ms
56,984 KB
testcase_24 AC 173 ms
57,076 KB
testcase_25 AC 176 ms
56,800 KB
testcase_26 AC 173 ms
57,360 KB
testcase_27 AC 170 ms
56,964 KB
testcase_28 AC 174 ms
56,832 KB
testcase_29 AC 176 ms
56,844 KB
testcase_30 AC 170 ms
57,060 KB
testcase_31 AC 163 ms
56,776 KB
testcase_32 AC 162 ms
57,068 KB
testcase_33 AC 164 ms
57,408 KB
testcase_34 AC 163 ms
55,060 KB
testcase_35 AC 163 ms
56,784 KB
testcase_36 AC 163 ms
57,072 KB
testcase_37 AC 162 ms
57,084 KB
testcase_38 AC 162 ms
57,060 KB
testcase_39 AC 164 ms
56,972 KB
testcase_40 AC 170 ms
57,216 KB
testcase_41 AC 167 ms
57,008 KB
testcase_42 AC 170 ms
56,984 KB
testcase_43 AC 166 ms
57,192 KB
testcase_44 AC 168 ms
57,252 KB
testcase_45 AC 165 ms
57,196 KB
testcase_46 AC 167 ms
57,000 KB
testcase_47 AC 164 ms
57,028 KB
testcase_48 AC 163 ms
57,136 KB
testcase_49 AC 162 ms
56,760 KB
testcase_50 AC 166 ms
57,060 KB
testcase_51 AC 161 ms
57,196 KB
testcase_52 AC 164 ms
57,056 KB
testcase_53 AC 165 ms
57,196 KB
testcase_54 AC 165 ms
56,936 KB
testcase_55 AC 165 ms
57,100 KB
testcase_56 AC 165 ms
57,236 KB
testcase_57 AC 165 ms
57,092 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 = B + a*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