QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#306073 | #7604. Find the Vertex | 11d10xy | WA | 6ms | 19404kb | C++14 | 353b | 2024-01-16 12:05:49 | 2024-01-16 12:05:50 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,m,d[500010];
basic_string<int>G[500010];
int main(){
cin>>n;
for(int i=1;i<=n;i++)scanf("%d",&d[i]);
for(int u,v;m--;)scanf("%d%d",&u,&v),G[u]+=v,G[v]+=u;
for(int i=1;i<=n;i++)if(!d[i]&&all_of(begin(G[i]),end(G[i]),[](int u){return d[u]==1;}))
return cout<<i,0;
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 19404kb
input:
5 6 1 0 1 1 2 5 4 1 2 3 2 3 4 4 2 1 5
output:
3
result:
wrong answer 1st numbers differ - expected: '2', found: '3'