QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#305634#4085. 통신망Lynkcat#0 1ms3644kbC++201.6kb2024-01-15 19:05:572024-07-04 03:18:59

Judging History

你现在查看的是最新测评结果

  • [2024-07-04 03:18:59]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3644kb
  • [2024-01-15 19:05:57]
  • 提交

answer

#include<bits/stdc++.h>
#include "communication.h"
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
// #define int ll
// #define N 
using namespace std;
const int N=2505;
int dfn[N],low[N],DFN,vis[N],vv[N];
poly G[N];
int tot;
void dfs(int k,int fa)
{
	dfn[k]=++DFN;
	low[k]=dfn[k];
	int son=0,bl=0;
	for (auto id:G[k])
	{
		if (vis[id]) continue;
		if (id==fa) continue;
		int u=vv[id]^k;
		// cout<<"edge "<<u<<" "<<k<<endl;
		if (dfn[u]==0)
		{
			son++;
			dfs(u,id);
			if (low[u]>=dfn[k]&&fa) bl=1; 
			low[k]=min(low[k],low[u]);
		} else
		{
			low[k]=min(low[k],dfn[u]);
		}
	}
	if (!fa&&son>=2) bl=1;
	tot+=bl;
	// cout<<k<<" "<<bl<<endl;
}
std::vector<int> find_num_critical(int n, std::vector< std::pair<int, int> > E)
{
	int m = (int)E.size();
	poly ans;
	for (int i=0;i<m;i++)
	{
		auto [u,v]=E[i];
		G[u].push_back(i);
		G[v].push_back(i);
		vv[i]=u^v;
	}
	for (int i=0;i<m;i++)
	{
		for (int j=1;j<=n;j++)
			dfn[j]=low[j]=0;
		vis[i]=1;
		tot=0;DFN=0;
		int tt=0;
		for (int j=1;j<=n;j++)
			if (!dfn[j])
			{
				tt++;
				dfs(j,-1);
				// cout<<endl;
			}
		// cout<<"??"<<tt<<endl;
		if (tt>2)
		{
			tt=n;
		} else
		if (tt==2)
		{
			tot=0;
			for (int j=1;j<=n;j++)
			{
				int u=0;
				for (auto id:G[j])
					if (id!=i) u++;
				if (u) tot++;
			}
		}
		ans.push_back(tot);
		vis[i]=0;
	}
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3644kb

input:

200 200
29 99
132 153
145 179
144 45
56 28
48 3
89 51
88 127
177 53
26 73
50 151
92 13
93 159
116 135
28 74
100 126
44 91
92 193
187 124
177 25
94 11
27 16
165 37
71 7
152 188
71 189
98 173
94 93
172 81
113 36
131 117
107 23
185 91
20 59
2 121
109 77
48 79
33 69
102 81
128 137
16 190
167 136
10 178
...

output:

Gyojun is handsome
199
199
199
199
200
199
200
200
200
199
200
199
199
102
200
199
200
199
101
199
200
200
200
200
199
199
199
200
199
102
200
199
200
199
199
200
199
200
199
200
200
199
199
200
199
199
200
200
199
200
200
199
200
200
200
200
200
199
199
200
199
199
200
101
200
199
199
200
199
200
2...

result:

wrong answer 15th lines differ - expected: '101', found: '102'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Runtime Error

Test #129:

score: 0
Runtime Error

input:

8000 8000
3334 4850
3702 6021
2278 2531
3485 5926
4321 314
4357 2816
4319 5050
1156 2107
4081 7202
6243 2320
7047 851
991 7155
1633 6760
3727 1879
2911 2993
4844 268
3467 5932
7915 7713
4183 4309
7329 1750
540 4486
6665 5370
7505 1560
1033 5053
2424 5725
5532 1809
2943 5853
4037 2466
3482 7480
410 5...

output:

Unauthorized output

result:


Subtask #4:

score: 0
Runtime Error

Test #185:

score: 0
Runtime Error

input:

8000 7999
6715 5630
5399 1611
522 5896
5200 288
4783 2611
5206 1534
1491 5946
2860 984
5854 7761
7173 2988
4855 7410
3295 451
457 2349
7896 6105
7685 6007
6778 7505
5872 2713
6470 1380
4248 3888
6388 2792
1047 3549
5226 97
509 409
4856 7396
4149 2439
5406 2518
3230 6097
6050 5856
2346 5118
3521 6541...

output:

Unauthorized output

result:


Subtask #5:

score: 0
Skipped

Dependency #2:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

0%