結果
問題 | No.2910 単体ホモロジー入門 |
ユーザー | tobisatis |
提出日時 | 2024-10-04 22:50:22 |
言語 | C# (.NET 8.0.203) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 3,036 bytes |
コンパイル時間 | 7,083 ms |
コンパイル使用メモリ | 164,404 KB |
実行使用メモリ | 187,652 KB |
最終ジャッジ日時 | 2024-10-04 22:50:33 |
合計ジャッジ時間 | 10,065 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 45 ms
29,312 KB |
testcase_01 | AC | 47 ms
30,080 KB |
testcase_02 | AC | 47 ms
30,464 KB |
testcase_03 | AC | 46 ms
30,208 KB |
testcase_04 | AC | 47 ms
30,336 KB |
testcase_05 | AC | 47 ms
30,192 KB |
testcase_06 | AC | 47 ms
30,200 KB |
testcase_07 | AC | 48 ms
30,208 KB |
testcase_08 | AC | 47 ms
29,696 KB |
testcase_09 | AC | 46 ms
29,312 KB |
testcase_10 | AC | 47 ms
30,208 KB |
testcase_11 | AC | 47 ms
30,188 KB |
testcase_12 | AC | 48 ms
30,336 KB |
testcase_13 | AC | 46 ms
29,952 KB |
testcase_14 | AC | 49 ms
30,208 KB |
testcase_15 | AC | 48 ms
30,080 KB |
testcase_16 | AC | 46 ms
30,336 KB |
testcase_17 | AC | 45 ms
30,080 KB |
testcase_18 | AC | 46 ms
30,336 KB |
testcase_19 | AC | 46 ms
30,336 KB |
testcase_20 | AC | 47 ms
30,336 KB |
testcase_21 | AC | 46 ms
30,336 KB |
testcase_22 | AC | 47 ms
30,080 KB |
testcase_23 | AC | 47 ms
29,952 KB |
testcase_24 | AC | 45 ms
29,696 KB |
testcase_25 | AC | 46 ms
30,208 KB |
testcase_26 | AC | 46 ms
30,208 KB |
testcase_27 | AC | 46 ms
30,336 KB |
testcase_28 | AC | 46 ms
29,568 KB |
testcase_29 | AC | 47 ms
30,332 KB |
testcase_30 | AC | 48 ms
30,208 KB |
testcase_31 | AC | 48 ms
30,336 KB |
testcase_32 | AC | 46 ms
30,336 KB |
testcase_33 | AC | 48 ms
30,336 KB |
testcase_34 | AC | 50 ms
30,332 KB |
testcase_35 | AC | 45 ms
29,312 KB |
testcase_36 | AC | 46 ms
30,208 KB |
testcase_37 | AC | 44 ms
29,568 KB |
testcase_38 | AC | 46 ms
30,336 KB |
testcase_39 | AC | 46 ms
30,336 KB |
testcase_40 | AC | 46 ms
30,080 KB |
testcase_41 | AC | 45 ms
29,568 KB |
testcase_42 | AC | 44 ms
29,696 KB |
testcase_43 | AC | 47 ms
30,336 KB |
testcase_44 | AC | 47 ms
30,336 KB |
testcase_45 | AC | 46 ms
30,208 KB |
testcase_46 | AC | 45 ms
187,652 KB |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (88 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
namespace AtCoder;#nullable enableusing System.Numerics;static class Extensions{public static T[] Repeat<T>(this int time, Func<T> F) => Enumerable.Range(0, time).Select(_ => F()).ToArray();public static List<T>? NextPermutation<T>(IEnumerable<T> p) where T : IComparable<T>{var a = p.ToList();var b = new List<T> { a[^1] };for (var i = a.Count - 2; i >= 0; i--){var t = a[i];if (t.CompareTo(b[^1]) >= 0) b.Add(t);else{var k = 0;while (k < b.Count && b[k].CompareTo(t) <= 0) k++;(b[k], a[i]) = (t, b[k]);for (var j = 0; j < b.Count; j++) a[i + 1 + j] = b[j];return a;}}return null;}}class AtCoder{object? Solve(){var n = Int();var m = Int();var adjz = new bool[n, n];for (var i = 0; i < m; i++){var u = Int();var v = Int();adjz[u, v] = adjz[v, u] = true;}var vs = 0;for (var i = 0; i < 3; i++) vs |= (1 << Int());if (n <= 2) return false;var perm = new List<int>();for (var i = 0; i < n; i++) perm.Add(i);while (perm != null){for (var k = 3; k <= n; k++){var ks = 0;for (var i = 0; i < 3; i++) ks |= (1 << perm[i]);if (ks == vs) continue;var f = true;for (var i = 0; i < k; i++){var u = perm[i];var v = perm[(i + 1) % k];f &= adjz[u, v];}if (f) return true;}perm = Extensions.NextPermutation(perm);}return false;}public static void Main() => new AtCoder().Run();public void Run(){var res = Solve();if (res != null){if (res is bool yes) res = yes ? "Yes" : "No";sw.WriteLine(res);}sw.Flush();}string[] input = Array.Empty<string>();int iter = 0;readonly StreamWriter sw = new(Console.OpenStandardOutput()) { AutoFlush = false };string String(){while (iter >= input.Length) (input, iter) = (Console.ReadLine()!.Trim().Split(' '), 0);return input[iter++];}T Input<T>() where T : IParsable<T> => T.Parse(String(), null);int Int() => Input<int>();void Out(object? x, string? separator = null){separator ??= Environment.NewLine;if (x is System.Collections.IEnumerable obj and not string){var firstLine = true;foreach (var item in obj){if (!firstLine) sw.Write(separator);firstLine = false;sw.Write(item);}}else sw.Write(x);sw.WriteLine();}}