結果

問題 No.338 アンケート機能
ユーザー piconic_Xpiconic_X
提出日時 2016-02-04 23:34:32
言語 OCaml
(5.1.0)
結果
TLE  
実行時間 -
コード長 797 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 21,580 KB
実行使用メモリ 12,576 KB
最終ジャッジ日時 2024-04-17 08:33:06
合計ジャッジ時間 3,697 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
12,444 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 TLE -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

let rec hasamiuchi k1 k2 a =
  let left, right = k1 *. a, k2 *. a in
  let cleft = ceil left in
  if cleft <= right then int_of_float (a +. cleft)
  else hasamiuchi k1 k2 (a+.1.)

let k1_k2 la lb =
  let la, lb = float_of_int la, float_of_int lb in
  let lamin, lamax = abs_float (la -. 0.5), la +. 0.5 in
  let lbmin, lbmax = abs_float (lb -. 0.5), lb +. 0.5 in
  let k1_la = (abs_float (100. -. lamax)) /. lamax +. 0.0000000001 in
  let k1_lb = lbmin /. (100. -. lbmin) in
  let k2_la = (100. -. lamin) /. lamin in
  let k2_lb = lbmax /. (abs_float (100. -. lbmax)) -. 0.0000000001 in
  let k1 = max k1_la k1_lb in
  let k2 = min k2_la k2_lb in
  k1, k2

let () =
  let k1, k2 = Scanf.sscanf (read_line()) ("%i %i") k1_k2 in
  let ans = hasamiuchi k1 k2 1. in
  print_int ans;
  print_endline ""
0