# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
941507 | Darren0724 | Tug of War (BOI15_tug) | C++17 | 873 ms | 6512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define LCBorz ios_base::sync_with_stdio(false); cin.tie(0);
#define all(x) x.begin(), x.end()
#define endl '\n'
const int N=60005;
const int INF=1e9;
const int M=20*30000;
int32_t main() {
LCBorz;
int n,k;cin>>n>>k;
int m=n*2;
vector<int> a(m),b(m),c(m),adj[N],deg(m+1);
for(int i=0;i<m;i++){
cin>>a[i]>>b[i]>>c[i];
b[i]+=n;
adj[a[i]].push_back(i);
adj[b[i]].push_back(i);
deg[a[i]]++;
deg[b[i]]++;
}
for(int i=1;i<=m;i++){
if(deg[i]==0){
cout<<"NO"<<endl;
return 0;
}
}
vector<int> vis(m);
queue<int> q;
int ptr=M;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |