QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#796648 | #7604. Find the Vertex | Cookie_Creamm | RE | 0ms | 0kb | C++23 | 1.5kb | 2024-12-01 23:09:15 | 2024-12-01 23:09:16 |
answer
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define vt vector
#define pb push_back
#define pii pair<int, int>
#define sz(dq) (int)dq.size()
#define forr(i, a, b) for(int i = a; i < b; i++)
#define fi first
#define se second
#define pll pair<ll, ll>
#define mpp make_pair
#define ALL(v) v.begin(), v.end()
#define ALLR(v) v.rbegin(), v.rend()
#define ld long double
ifstream fin("store.inp");
ofstream fout("store.out");
const ll mxn = 5e5 + 5, inf = 1e9, mod = 998244353, sq = 800, mxv = 1e6 + 5, pr = 37, mod2 = 1e9 + 9, mod3 = 998244353;
//const int x[4] = {0, -1, 0, 1};
const int x[4] = {1, -1, 0, 0};
const int y[4] = {0, 0, 1, -1};
//const char dir[4] = {'D', 'U', 'R', 'L'};
//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, m;
int d[mxn + 1];
bool ok[mxn + 1];
void solve(){
cin >> n >> m;
for(int i = 1; i <= n; i++){
cin >> d[i]; ok[i] = (d[i] == 0);
}
for(int i = 0; i < m; i++){
int u, v; cin >> u >> v;
ok[v] &= (d[u] == 1); ok[u] &= (d[v] == 1);
}
for(int i = 1; i <= n; i++){
if(ok[i]){
cout << i; return;
}
}
}
signed main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//freopen("ARRAY.inp", "r", stdin);
//freopen("ARRAY.out", "w", stdout);
int tt; tt = 1;
while(tt--){
solve();
}
return(0);
}
详细
Test #1:
score: 0
Dangerous Syscalls
input:
5 6 1 0 1 1 2 5 4 1 2 3 2 3 4 4 2 1 5