結果
問題 | No.1254 補強への架け橋 |
ユーザー | fgwiebfaoish |
提出日時 | 2020-10-09 23:43:17 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 248 ms / 2,000 ms |
コード長 | 2,993 bytes |
コンパイル時間 | 813 ms |
コンパイル使用メモリ | 108,416 KB |
実行使用メモリ | 52,732 KB |
最終ジャッジ日時 | 2024-07-20 14:34:29 |
合計ジャッジ時間 | 16,339 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 22 ms
17,920 KB |
testcase_01 | AC | 23 ms
18,048 KB |
testcase_02 | AC | 25 ms
17,920 KB |
testcase_03 | AC | 23 ms
17,920 KB |
testcase_04 | AC | 25 ms
17,920 KB |
testcase_05 | AC | 24 ms
18,048 KB |
testcase_06 | AC | 26 ms
17,920 KB |
testcase_07 | AC | 24 ms
18,176 KB |
testcase_08 | AC | 24 ms
17,920 KB |
testcase_09 | AC | 24 ms
17,920 KB |
testcase_10 | AC | 24 ms
18,048 KB |
testcase_11 | AC | 24 ms
18,048 KB |
testcase_12 | AC | 26 ms
18,048 KB |
testcase_13 | AC | 24 ms
18,048 KB |
testcase_14 | AC | 25 ms
17,792 KB |
testcase_15 | AC | 24 ms
18,048 KB |
testcase_16 | AC | 24 ms
18,176 KB |
testcase_17 | AC | 24 ms
18,048 KB |
testcase_18 | AC | 24 ms
18,176 KB |
testcase_19 | AC | 25 ms
18,176 KB |
testcase_20 | AC | 24 ms
18,048 KB |
testcase_21 | AC | 23 ms
17,920 KB |
testcase_22 | AC | 24 ms
18,048 KB |
testcase_23 | AC | 26 ms
18,048 KB |
testcase_24 | AC | 25 ms
18,048 KB |
testcase_25 | AC | 25 ms
18,048 KB |
testcase_26 | AC | 25 ms
18,048 KB |
testcase_27 | AC | 25 ms
18,048 KB |
testcase_28 | AC | 25 ms
18,176 KB |
testcase_29 | AC | 25 ms
18,048 KB |
testcase_30 | AC | 24 ms
17,792 KB |
testcase_31 | AC | 25 ms
18,176 KB |
testcase_32 | AC | 23 ms
18,048 KB |
testcase_33 | AC | 24 ms
17,792 KB |
testcase_34 | AC | 25 ms
17,792 KB |
testcase_35 | AC | 26 ms
18,048 KB |
testcase_36 | AC | 26 ms
17,920 KB |
testcase_37 | AC | 23 ms
18,176 KB |
testcase_38 | AC | 25 ms
18,048 KB |
testcase_39 | AC | 24 ms
17,920 KB |
testcase_40 | AC | 25 ms
18,176 KB |
testcase_41 | AC | 26 ms
17,920 KB |
testcase_42 | AC | 26 ms
18,048 KB |
testcase_43 | AC | 25 ms
18,432 KB |
testcase_44 | AC | 25 ms
18,176 KB |
testcase_45 | AC | 27 ms
18,176 KB |
testcase_46 | AC | 26 ms
18,560 KB |
testcase_47 | AC | 26 ms
18,176 KB |
testcase_48 | AC | 26 ms
18,304 KB |
testcase_49 | AC | 26 ms
17,920 KB |
testcase_50 | AC | 26 ms
18,304 KB |
testcase_51 | AC | 24 ms
18,432 KB |
testcase_52 | AC | 25 ms
18,560 KB |
testcase_53 | AC | 25 ms
18,560 KB |
testcase_54 | AC | 26 ms
18,560 KB |
testcase_55 | AC | 26 ms
18,560 KB |
testcase_56 | AC | 24 ms
17,920 KB |
testcase_57 | AC | 24 ms
18,432 KB |
testcase_58 | AC | 24 ms
18,432 KB |
testcase_59 | AC | 27 ms
18,048 KB |
testcase_60 | AC | 24 ms
18,176 KB |
testcase_61 | AC | 26 ms
18,560 KB |
testcase_62 | AC | 25 ms
18,176 KB |
testcase_63 | AC | 41 ms
23,808 KB |
testcase_64 | AC | 28 ms
19,456 KB |
testcase_65 | AC | 34 ms
21,632 KB |
testcase_66 | AC | 33 ms
20,736 KB |
testcase_67 | AC | 29 ms
19,200 KB |
testcase_68 | AC | 33 ms
21,376 KB |
testcase_69 | AC | 36 ms
22,144 KB |
testcase_70 | AC | 29 ms
19,584 KB |
testcase_71 | AC | 28 ms
19,456 KB |
testcase_72 | AC | 39 ms
22,272 KB |
testcase_73 | AC | 30 ms
19,584 KB |
testcase_74 | AC | 36 ms
21,888 KB |
testcase_75 | AC | 32 ms
20,992 KB |
testcase_76 | AC | 26 ms
18,688 KB |
testcase_77 | AC | 30 ms
20,480 KB |
testcase_78 | AC | 39 ms
23,168 KB |
testcase_79 | AC | 38 ms
23,168 KB |
testcase_80 | AC | 36 ms
22,272 KB |
testcase_81 | AC | 41 ms
23,424 KB |
testcase_82 | AC | 38 ms
22,784 KB |
testcase_83 | AC | 200 ms
34,936 KB |
testcase_84 | AC | 197 ms
34,432 KB |
testcase_85 | AC | 121 ms
29,936 KB |
testcase_86 | AC | 167 ms
32,880 KB |
testcase_87 | AC | 177 ms
33,656 KB |
testcase_88 | AC | 48 ms
24,064 KB |
testcase_89 | AC | 205 ms
34,676 KB |
testcase_90 | AC | 126 ms
30,576 KB |
testcase_91 | AC | 106 ms
28,792 KB |
testcase_92 | AC | 68 ms
25,600 KB |
testcase_93 | AC | 161 ms
32,120 KB |
testcase_94 | AC | 146 ms
31,480 KB |
testcase_95 | AC | 144 ms
31,336 KB |
testcase_96 | AC | 183 ms
34,040 KB |
testcase_97 | AC | 93 ms
27,648 KB |
testcase_98 | AC | 194 ms
34,040 KB |
testcase_99 | AC | 116 ms
29,680 KB |
testcase_100 | AC | 196 ms
34,936 KB |
testcase_101 | AC | 61 ms
25,344 KB |
testcase_102 | AC | 47 ms
23,808 KB |
testcase_103 | AC | 65 ms
25,600 KB |
testcase_104 | AC | 80 ms
27,136 KB |
testcase_105 | AC | 152 ms
32,112 KB |
testcase_106 | AC | 98 ms
28,268 KB |
testcase_107 | AC | 199 ms
34,812 KB |
testcase_108 | AC | 194 ms
34,424 KB |
testcase_109 | AC | 158 ms
32,240 KB |
testcase_110 | AC | 147 ms
31,348 KB |
testcase_111 | AC | 160 ms
31,612 KB |
testcase_112 | AC | 84 ms
26,880 KB |
testcase_113 | AC | 148 ms
31,212 KB |
testcase_114 | AC | 100 ms
28,020 KB |
testcase_115 | AC | 50 ms
24,320 KB |
testcase_116 | AC | 109 ms
29,176 KB |
testcase_117 | AC | 82 ms
27,008 KB |
testcase_118 | AC | 182 ms
33,908 KB |
testcase_119 | AC | 120 ms
29,676 KB |
testcase_120 | AC | 191 ms
33,528 KB |
testcase_121 | AC | 70 ms
25,984 KB |
testcase_122 | AC | 105 ms
28,788 KB |
testcase_123 | AC | 24 ms
18,176 KB |
testcase_124 | AC | 245 ms
52,732 KB |
testcase_125 | AC | 248 ms
52,600 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Linq; using System.Text; using System.IO; using System.Reflection; using static System.Math; using System.Numerics; using System.Threading; using System.Runtime.CompilerServices; static class Program{ const int mod=(int)1e9+7; static List<(int,int)>[] li; static bool[] b,h; static int[] low,ord; static void Main(){ Sc sc=new Sc(); var s=sc.Ia; int n=s[0],m=n; li=new List<(int,int)>[n+1]; b=new bool[n+1]; h=new bool[n+1]; low=new int[n+1]; ord=new int[n+1]; for(int i=1;i<=n;i++){li[i]=new List<(int,int)>();} for(int i=0;i<m;i++){ var e=sc.Ia; li[e[0]].Add((e[1],i+1)); li[e[1]].Add((e[0],i+1)); } Fu(1,0,-1); var ans=new List<int>(); for(int i=1;i<=n;i++){ if(!h[i]){ ans.Add(i); } } Console.WriteLine(ans.Count); Console.WriteLine("{0}",string.Join(" ",ans)); } static void Fu(int a,int g,int p){ b[a]=true; ord[a]=low[a]=g; for(int i=0;i<li[a].Count;i++){ if(!b[li[a][i].Item1]){ Fu(li[a][i].Item1,g+1,a); if(low[li[a][i].Item1]==ord[li[a][i].Item1]){h[li[a][i].Item2]=true;} } if(li[a][i].Item1!=p){low[a]=Min(low[li[a][i].Item1],low[a]);} } } } public class Sc{ public int I{get{return int.Parse(Console.ReadLine());}} public long L{get{return long.Parse(Console.ReadLine());}} public double D{get{return double.Parse(Console.ReadLine());}} public string S{get{return Console.ReadLine();}} public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}} public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}} public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}} public string[] Sa{get{return Console.ReadLine().Split();}} public object[] Oa{get{return Console.ReadLine().Split();}} public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}} public int[] Ia3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),int.Parse);} public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}} public long[] La3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),long.Parse);} public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}} public double[] Da3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),double.Parse);} public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;} public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;} public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;} public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;} }