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 int long long
#define double long double
#define vi vector<int>
#define pii pair<int,int>
#define si set<int>
#define mii map<int,int>
#define F first
#define S second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define ef emplace_front
#define pob pop_back
#define pof pop_front
const int INF=2147483647;
const int MOD=1000000007;
const int mod=998244353;
const double eps=1e-12;
int cnt[1501];
int q;
int v1,v2;
void initialize(int n){
q=n*(n-1)/2;
for(int i=0;i<n;i++){
cnt[i]=i;
}
}
int hasEdge(int v1,int v2){
if(v1>v2) swap(v1,v2);
cnt[v2]--;
if( cnt[v2]==0 ){
/***debug***
cout<<"Yes"<<endl;
***debug***/
return 1;
}
else{
/***debug***
cout<<"No"<<endl;
***debug***/
return 0;
}
}
/******
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
initialize(n);
for(int i=0;i<q;i++){
cin>>v1>>v2;
hasEdge(v1,v2);
}
return 0;
}
******/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |