結果
問題 | No.550 夏休みの思い出(1) |
ユーザー | 6soukiti29 |
提出日時 | 2017-07-29 06:05:37 |
言語 | Nim (2.0.2) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,765 bytes |
コンパイル時間 | 2,933 ms |
コンパイル使用メモリ | 68,352 KB |
実行使用メモリ | 11,608 KB |
最終ジャッジ日時 | 2023-09-12 13:42:51 |
合計ジャッジ時間 | 9,433 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
testcase_57 | -- | - |
ソースコード
import sequtils,strutils,math var A,B,C : float64 l,r : float64 ans : array[3,int] s,t,u : int64 (s,t,u) = stdin.readline.split.map(parseBiggestInt) (A,B,C) = (s.float64,t.float64,u.float64) proc f(x: float64):float64= return x * x * x + A * x * x + B * x + C proc slope(x : float64):float64= return 3 * x * x + 2 * A * x + B proc s2(x : float64):float64= return 6 * x + 2 * A l = -pow(10.0,9.0).float64 r = pow(10.0,9.0).float64 while slope(l) > 0.0 or slope(r) > 0.0: if s2((l + r) / 2) < 0.0: l = (l + r) / 2 else: r = (l + r) / 2 var l2 = -pow(10.0,9.0).float64 r2 = l while r2 - l2 > 1: if slope((l2 + r2) / 2.0) > 0.0: l2 = (l2 + r2) / 2.0 else: r2 = (l2 + r2) / 2.0 var r3 = pow(10.0,9.0).float64 l3 = r while abs(r3 - l3) > 1: if slope((l3 + r3) / 2.0) > 0.0: r3 = (l3 + r3) / 2.0 else: l3 = (l3 + r3) / 2.0 var l4 = -pow(10.0,9.0).float64 r4 = r2 m : float64 while f(r4) > 1 or r4 - l4 > 1: m = (l4 + r4) / 2.0 if f(m) >= 0.0: r4 = m else: l4 = m ans[0] = round(r4).int var l5 = l2 r5 = r3 while f(r5) < -1 or abs(r5 - l5) > 1: m = (l5 + r5) / 2.0 if f(m) > 0.0: l5 = m else: r5 = m ans[1] = round(r5).int var l6 = r3 r6 = pow(10.0,9.0).float64 while abs(f(r6)) > 1 and abs(r6 - l6) > 1: m = (l6 + r6) / 2.0 if f(m) > 0.0: r6 = m else: l6 = m ans[2] = round(r6).int for a in -10..10: for b in -10..10: for c in -10..10: if (ans[0] + a).int64 * (ans[1] + b).int64 * (ans[2] + c).int64 == -u: ans[0] += a ans[1] += b ans[2] += c echo ans.join(" ")