QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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;
}
Details
Tip: Click on the bar to expand more detailed information
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'