# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
914270 |
2024-01-21T13:35:38 Z |
Abito |
Joker (BOI20_joker) |
C++14 |
|
0 ms |
0 KB |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
//#define int long long
#define ll long long
#define y1 YONE
#define free freeee
#define lcm llcm
/*
⠄⠄⠄⠄⢠⣿⣿⣿⣿⣿⢻⣿⣿⣿⣿⣿⣿⣿⣿⣯⢻⣿⣿⣿⣿⣆⠄⠄⠄
⠄⠄⣼⢀⣿⣿⣿⣿⣏⡏⠄⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢻⣿⣿⣿⣿⡆⠄⠄
⠄⠄⡟⣼⣿⣿⣿⣿⣿⠄⠄⠄⠈⠻⣿⣿⣿⣿⣿⣿⣿⣇⢻⣿⣿⣿⣿⠄⠄
⠄⢰⠃⣿⣿⠿⣿⣿⣿⠄⠄⠄⠄⠄⠄⠙⠿⣿⣿⣿⣿⣿⠄⢿⣿⣿⣿⡄⠄
⠄⢸⢠⣿⣿⣧⡙⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠈⠛⢿⣿⣿⡇⠸⣿⡿⣸⡇⠄
⠄⠈⡆⣿⣿⣿⣿⣦⡙⠳⠄⠄⠄⠄⠄⠄⢀⣠⣤⣀⣈⠙⠃⠄⠿⢇⣿⡇⠄
⠄⠄⡇⢿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⣠⣶⣿⣿⣿⣿⣿⣿⣷⣆⡀⣼⣿⡇⠄
⠄⠄⢹⡘⣿⣿⣿⢿⣷⡀⠄⢀⣴⣾⣟⠉⠉⠉⠉⣽⣿⣿⣿⣿⠇⢹⣿⠃⠄
⠄⠄⠄⢷⡘⢿⣿⣎⢻⣷⠰⣿⣿⣿⣿⣦⣀⣀⣴⣿⣿⣿⠟⢫⡾⢸⡟⠄.
⠄⠄⠄⠄⠻⣦⡙⠿⣧⠙⢷⠙⠻⠿⢿⡿⠿⠿⠛⠋⠉⠄⠂⠘⠁⠞⠄⠄⠄
⠄⠄⠄⠄⠄⠈⠙⠑⣠⣤⣴⡖⠄⠿⣋⣉⣉⡁⠄⢾⣦⠄⠄⠄⠄⠄⠄⠄⠄
*/
typedef unsigned long long ull;
using namespace std;
const int N=1e5+5;
int n,m,q,l,r,qq,vis[N];
vector<pair<int,int>> adj[N];
bool cyc,tin[N],t;
void dfs(int x){
t=!t;
vis[x]=qq;
tin[x]=t;
for (auto u:adj[x]){
if (u.S>=l && u.S<=r) continue;
if (vis[u.F]==qq) cyc|=!(tin[u.F]^tin[x]);
else dfs(u.F,x);
if (cyc) break;
}t=!t;
return;
}
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
cin>>n>>m>>q;
for (int i=1;i<=m;i++){
int x,y;
cin>>x>>y;
adj[x].pb({y,i});
adj[y].pb({x,i});
}
while (q--){
cin>>l>>r;
qq++;
cyc=0;
for (int i=1;i<=n;i++){
if (vis[i]==qq) continue;
dfs(i);
if (cyc) break;
}
if (cyc) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
Compilation message
Joker.cpp: In function 'void dfs(int)':
Joker.cpp:43:23: error: too many arguments to function 'void dfs(int)'
43 | else dfs(u.F,x);
| ^
Joker.cpp:36:6: note: declared here
36 | void dfs(int x){
| ^~~