結果
問題 | No.5008 [Cherry Alpha] Discrete Pendulum with Air Resistance |
ユーザー | kakel-san |
提出日時 | 2022-10-15 01:15:42 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 1,837 ms / 2,000 ms |
コード長 | 2,401 bytes |
コンパイル時間 | 1,844 ms |
実行使用メモリ | 26,180 KB |
スコア | 972,667,111,149 |
最終ジャッジ日時 | 2022-10-15 01:17:25 |
合計ジャッジ時間 | 101,939 ms |
ジャッジサーバーID (参考情報) |
judge8 / judge10 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,826 ms
23,964 KB |
testcase_01 | AC | 1,826 ms
23,892 KB |
testcase_02 | AC | 1,837 ms
24,020 KB |
testcase_03 | AC | 1,826 ms
23,868 KB |
testcase_04 | AC | 1,826 ms
23,984 KB |
testcase_05 | AC | 1,826 ms
23,900 KB |
testcase_06 | AC | 1,826 ms
24,028 KB |
testcase_07 | AC | 1,834 ms
23,828 KB |
testcase_08 | AC | 1,826 ms
23,940 KB |
testcase_09 | AC | 1,826 ms
24,088 KB |
testcase_10 | AC | 1,827 ms
25,904 KB |
testcase_11 | AC | 1,827 ms
23,844 KB |
testcase_12 | AC | 1,826 ms
23,904 KB |
testcase_13 | AC | 1,827 ms
24,008 KB |
testcase_14 | AC | 1,827 ms
23,684 KB |
testcase_15 | AC | 1,825 ms
23,876 KB |
testcase_16 | AC | 1,827 ms
23,820 KB |
testcase_17 | AC | 1,826 ms
23,948 KB |
testcase_18 | AC | 1,826 ms
24,112 KB |
testcase_19 | AC | 1,825 ms
23,948 KB |
testcase_20 | AC | 1,826 ms
24,032 KB |
testcase_21 | AC | 1,827 ms
24,048 KB |
testcase_22 | AC | 1,825 ms
23,924 KB |
testcase_23 | AC | 1,827 ms
23,912 KB |
testcase_24 | AC | 1,826 ms
23,872 KB |
testcase_25 | AC | 1,825 ms
23,980 KB |
testcase_26 | AC | 1,832 ms
23,952 KB |
testcase_27 | AC | 1,827 ms
23,892 KB |
testcase_28 | AC | 1,827 ms
24,056 KB |
testcase_29 | AC | 1,827 ms
24,040 KB |
testcase_30 | AC | 1,827 ms
23,880 KB |
testcase_31 | AC | 1,826 ms
25,928 KB |
testcase_32 | AC | 1,828 ms
23,868 KB |
testcase_33 | AC | 1,826 ms
25,964 KB |
testcase_34 | AC | 1,827 ms
25,812 KB |
testcase_35 | AC | 1,826 ms
23,796 KB |
testcase_36 | AC | 1,826 ms
25,804 KB |
testcase_37 | AC | 1,827 ms
23,888 KB |
testcase_38 | AC | 1,827 ms
25,884 KB |
testcase_39 | AC | 1,828 ms
24,572 KB |
testcase_40 | AC | 1,826 ms
26,000 KB |
testcase_41 | AC | 1,826 ms
23,988 KB |
testcase_42 | AC | 1,826 ms
24,600 KB |
testcase_43 | AC | 1,827 ms
25,956 KB |
testcase_44 | AC | 1,828 ms
25,708 KB |
testcase_45 | AC | 1,826 ms
24,008 KB |
testcase_46 | AC | 1,827 ms
24,092 KB |
testcase_47 | AC | 1,826 ms
26,008 KB |
testcase_48 | AC | 1,826 ms
26,180 KB |
testcase_49 | AC | 1,825 ms
26,004 KB |
ソースコード
using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static void Main() { Solve(); } static void Solve() { var start = DateTime.Now; var c = NList; var (n, k) = (c[0], c[1]); var t = NList; var u = NList; var r = new Random(); var limit = 1.8; var maxpt = 0.0; var count = 0; var res = new int[n][]; for (var i = 0; i < n; ++i) res[i] = new int[3]; while ((DateTime.Now - start).TotalSeconds < limit) { var b = new int[n]; var m = new int[n]; var e = new int[n]; for (var i = 0; i < n; ++i) { b[i] = r.Next(1, 50000000); m[i] = b[i]; e[i] = 1; } var sumt = 0.0; var sumu = 0.0; var post = new int[n]; var posu = new int[n]; for (var i = 0; i < n; ++i) { post[i] = Pos(t[i], b[i]); posu[i] = Pos(u[i], b[i]); } for (var i = 0; i < k; ++i) { var rt = 0.0; var ru = 0; for (var x = 0; x < n; ++x) for (var y = x + 1; y < n; ++y) { rt += (double)Math.Abs(post[x] - post[y]) / (b[x] + b[y]); ru = Math.Max(ru, posu[x] - posu[y]); } sumt += rt * 20000000 / n / (n - 1); sumu += 10000000 / (1 + Math.Sqrt(ru / 20.0)); } if (maxpt < sumt * sumu / n / n) { maxpt = sumt * sumu / n / n; for (var i = 0; i < n; ++i) { res[i][0] = b[i]; res[i][1] = m[i]; res[i][2] = e[i]; } } ++count; } WriteLine(string.Join("\n", res.Select(ri => string.Join(" ", ri)))); } static int Pos(int t, int b) { var p = t % (b * 4); if (p >= b && p < b * 3) return b * 2 - p; else if (p >= b * 3) return p - b * 4; return p; } }