# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
951198 |
2024-03-21T11:02:09 Z |
koukirocks |
Joker (BOI20_joker) |
C++17 |
|
2000 ms |
14684 KB |
#include <bits/stdc++.h>
#define speed ios_base::sync_with_stdio(0); cin.tie(0)
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MAX=2e5+10,P=998244353;
const ll INF=0x3f3f3f3f,oo=0x3f3f3f3f3f3f3f3f;
int n,m,q;
struct edge {
int a,b;
} egs[MAX];
vector<pii> G[MAX];
struct query{
int l,r,id;
}qry[MAX];
int main() {
speed;
cin>>n>>m>>q;
for (int i=1;i<=m;i++) {
int a,b;
cin>>a>>b;
egs[i]={a,b};
G[a].emplace_back(b,i);
G[b].emplace_back(a,i);
}
for (int i=1;i<=q;i++) {
cin>>qry[i].l>>qry[i].r;
qry[i].id=i;
bool flag=false;
vector<int> clr(n+1,-1);
queue<int> BFS;
for (int st=1;st<=n;st++) {
if (clr[st]!=-1) continue;
clr[st]=0;
BFS.push(st);
while (!BFS.empty()) {
int v=BFS.front();
BFS.pop();
for (auto [u,id]:G[v]) {
if (qry[i].l<=id and id<=qry[i].r) continue;
if (clr[u]==-1) {
clr[u]=clr[v]^1;
BFS.push(u);
}
if ((clr[u]^clr[v])==0) {
flag=true;
break;
}
}
if (flag) break;
}
if (flag) break;
}
if (flag) cout<<"YES\n";
else cout<<"NO\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6488 KB |
Output is correct |
2 |
Correct |
2 ms |
6744 KB |
Output is correct |
3 |
Correct |
2 ms |
6624 KB |
Output is correct |
4 |
Correct |
2 ms |
6492 KB |
Output is correct |
5 |
Correct |
2 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6488 KB |
Output is correct |
7 |
Correct |
2 ms |
6492 KB |
Output is correct |
8 |
Correct |
3 ms |
6488 KB |
Output is correct |
9 |
Correct |
3 ms |
6488 KB |
Output is correct |
10 |
Correct |
1 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6488 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
2 ms |
6492 KB |
Output is correct |
14 |
Correct |
2 ms |
6488 KB |
Output is correct |
15 |
Correct |
2 ms |
6492 KB |
Output is correct |
16 |
Correct |
2 ms |
6640 KB |
Output is correct |
17 |
Correct |
2 ms |
6624 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
6492 KB |
Output is correct |
21 |
Correct |
2 ms |
6492 KB |
Output is correct |
22 |
Correct |
2 ms |
6492 KB |
Output is correct |
23 |
Correct |
2 ms |
6492 KB |
Output is correct |
24 |
Correct |
2 ms |
6488 KB |
Output is correct |
25 |
Correct |
1 ms |
6492 KB |
Output is correct |
26 |
Correct |
1 ms |
6492 KB |
Output is correct |
27 |
Correct |
2 ms |
6488 KB |
Output is correct |
28 |
Correct |
2 ms |
6492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6488 KB |
Output is correct |
2 |
Correct |
2 ms |
6744 KB |
Output is correct |
3 |
Correct |
2 ms |
6624 KB |
Output is correct |
4 |
Correct |
2 ms |
6492 KB |
Output is correct |
5 |
Correct |
2 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6488 KB |
Output is correct |
7 |
Correct |
2 ms |
6492 KB |
Output is correct |
8 |
Correct |
3 ms |
6488 KB |
Output is correct |
9 |
Correct |
3 ms |
6488 KB |
Output is correct |
10 |
Correct |
1 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6488 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
2 ms |
6492 KB |
Output is correct |
14 |
Correct |
2 ms |
6488 KB |
Output is correct |
15 |
Correct |
2 ms |
6492 KB |
Output is correct |
16 |
Correct |
2 ms |
6640 KB |
Output is correct |
17 |
Correct |
2 ms |
6624 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
6492 KB |
Output is correct |
21 |
Correct |
2 ms |
6492 KB |
Output is correct |
22 |
Correct |
2 ms |
6492 KB |
Output is correct |
23 |
Correct |
2 ms |
6492 KB |
Output is correct |
24 |
Correct |
2 ms |
6488 KB |
Output is correct |
25 |
Correct |
1 ms |
6492 KB |
Output is correct |
26 |
Correct |
1 ms |
6492 KB |
Output is correct |
27 |
Correct |
2 ms |
6488 KB |
Output is correct |
28 |
Correct |
2 ms |
6492 KB |
Output is correct |
29 |
Correct |
70 ms |
6696 KB |
Output is correct |
30 |
Correct |
44 ms |
6744 KB |
Output is correct |
31 |
Correct |
32 ms |
6624 KB |
Output is correct |
32 |
Correct |
20 ms |
6740 KB |
Output is correct |
33 |
Correct |
8 ms |
6748 KB |
Output is correct |
34 |
Correct |
31 ms |
6748 KB |
Output is correct |
35 |
Correct |
50 ms |
6740 KB |
Output is correct |
36 |
Correct |
16 ms |
6636 KB |
Output is correct |
37 |
Correct |
67 ms |
6980 KB |
Output is correct |
38 |
Correct |
66 ms |
6740 KB |
Output is correct |
39 |
Correct |
44 ms |
6740 KB |
Output is correct |
40 |
Correct |
24 ms |
6748 KB |
Output is correct |
41 |
Correct |
19 ms |
6628 KB |
Output is correct |
42 |
Correct |
21 ms |
6748 KB |
Output is correct |
43 |
Correct |
3 ms |
6744 KB |
Output is correct |
44 |
Correct |
5 ms |
6748 KB |
Output is correct |
45 |
Correct |
5 ms |
6752 KB |
Output is correct |
46 |
Correct |
9 ms |
6744 KB |
Output is correct |
47 |
Correct |
26 ms |
6492 KB |
Output is correct |
48 |
Correct |
29 ms |
6492 KB |
Output is correct |
49 |
Correct |
38 ms |
6740 KB |
Output is correct |
50 |
Correct |
40 ms |
6744 KB |
Output is correct |
51 |
Correct |
21 ms |
6748 KB |
Output is correct |
52 |
Correct |
26 ms |
6740 KB |
Output is correct |
53 |
Correct |
35 ms |
6740 KB |
Output is correct |
54 |
Correct |
48 ms |
7000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6488 KB |
Output is correct |
2 |
Correct |
2 ms |
6744 KB |
Output is correct |
3 |
Execution timed out |
2031 ms |
14684 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6488 KB |
Output is correct |
2 |
Correct |
2 ms |
6744 KB |
Output is correct |
3 |
Correct |
2 ms |
6624 KB |
Output is correct |
4 |
Correct |
2 ms |
6492 KB |
Output is correct |
5 |
Correct |
2 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6488 KB |
Output is correct |
7 |
Correct |
2 ms |
6492 KB |
Output is correct |
8 |
Correct |
3 ms |
6488 KB |
Output is correct |
9 |
Correct |
3 ms |
6488 KB |
Output is correct |
10 |
Correct |
1 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6488 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
2 ms |
6492 KB |
Output is correct |
14 |
Correct |
2 ms |
6488 KB |
Output is correct |
15 |
Correct |
2 ms |
6492 KB |
Output is correct |
16 |
Correct |
2 ms |
6640 KB |
Output is correct |
17 |
Correct |
2 ms |
6624 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
6492 KB |
Output is correct |
21 |
Correct |
2 ms |
6492 KB |
Output is correct |
22 |
Correct |
2 ms |
6492 KB |
Output is correct |
23 |
Correct |
2 ms |
6492 KB |
Output is correct |
24 |
Correct |
2 ms |
6488 KB |
Output is correct |
25 |
Correct |
1 ms |
6492 KB |
Output is correct |
26 |
Correct |
1 ms |
6492 KB |
Output is correct |
27 |
Correct |
2 ms |
6488 KB |
Output is correct |
28 |
Correct |
2 ms |
6492 KB |
Output is correct |
29 |
Execution timed out |
2031 ms |
14684 KB |
Time limit exceeded |
30 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6488 KB |
Output is correct |
2 |
Correct |
2 ms |
6744 KB |
Output is correct |
3 |
Correct |
2 ms |
6624 KB |
Output is correct |
4 |
Correct |
2 ms |
6492 KB |
Output is correct |
5 |
Correct |
2 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6488 KB |
Output is correct |
7 |
Correct |
2 ms |
6492 KB |
Output is correct |
8 |
Correct |
3 ms |
6488 KB |
Output is correct |
9 |
Correct |
3 ms |
6488 KB |
Output is correct |
10 |
Correct |
1 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6488 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
2 ms |
6492 KB |
Output is correct |
14 |
Correct |
2 ms |
6488 KB |
Output is correct |
15 |
Correct |
2 ms |
6492 KB |
Output is correct |
16 |
Correct |
2 ms |
6640 KB |
Output is correct |
17 |
Correct |
2 ms |
6624 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
6492 KB |
Output is correct |
21 |
Correct |
2 ms |
6492 KB |
Output is correct |
22 |
Correct |
2 ms |
6492 KB |
Output is correct |
23 |
Correct |
2 ms |
6492 KB |
Output is correct |
24 |
Correct |
2 ms |
6488 KB |
Output is correct |
25 |
Correct |
1 ms |
6492 KB |
Output is correct |
26 |
Correct |
1 ms |
6492 KB |
Output is correct |
27 |
Correct |
2 ms |
6488 KB |
Output is correct |
28 |
Correct |
2 ms |
6492 KB |
Output is correct |
29 |
Correct |
70 ms |
6696 KB |
Output is correct |
30 |
Correct |
44 ms |
6744 KB |
Output is correct |
31 |
Correct |
32 ms |
6624 KB |
Output is correct |
32 |
Correct |
20 ms |
6740 KB |
Output is correct |
33 |
Correct |
8 ms |
6748 KB |
Output is correct |
34 |
Correct |
31 ms |
6748 KB |
Output is correct |
35 |
Correct |
50 ms |
6740 KB |
Output is correct |
36 |
Correct |
16 ms |
6636 KB |
Output is correct |
37 |
Correct |
67 ms |
6980 KB |
Output is correct |
38 |
Correct |
66 ms |
6740 KB |
Output is correct |
39 |
Correct |
44 ms |
6740 KB |
Output is correct |
40 |
Correct |
24 ms |
6748 KB |
Output is correct |
41 |
Correct |
19 ms |
6628 KB |
Output is correct |
42 |
Correct |
21 ms |
6748 KB |
Output is correct |
43 |
Correct |
3 ms |
6744 KB |
Output is correct |
44 |
Correct |
5 ms |
6748 KB |
Output is correct |
45 |
Correct |
5 ms |
6752 KB |
Output is correct |
46 |
Correct |
9 ms |
6744 KB |
Output is correct |
47 |
Correct |
26 ms |
6492 KB |
Output is correct |
48 |
Correct |
29 ms |
6492 KB |
Output is correct |
49 |
Correct |
38 ms |
6740 KB |
Output is correct |
50 |
Correct |
40 ms |
6744 KB |
Output is correct |
51 |
Correct |
21 ms |
6748 KB |
Output is correct |
52 |
Correct |
26 ms |
6740 KB |
Output is correct |
53 |
Correct |
35 ms |
6740 KB |
Output is correct |
54 |
Correct |
48 ms |
7000 KB |
Output is correct |
55 |
Execution timed out |
2045 ms |
14548 KB |
Time limit exceeded |
56 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6488 KB |
Output is correct |
2 |
Correct |
2 ms |
6744 KB |
Output is correct |
3 |
Correct |
2 ms |
6624 KB |
Output is correct |
4 |
Correct |
2 ms |
6492 KB |
Output is correct |
5 |
Correct |
2 ms |
6492 KB |
Output is correct |
6 |
Correct |
1 ms |
6488 KB |
Output is correct |
7 |
Correct |
2 ms |
6492 KB |
Output is correct |
8 |
Correct |
3 ms |
6488 KB |
Output is correct |
9 |
Correct |
3 ms |
6488 KB |
Output is correct |
10 |
Correct |
1 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6488 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
2 ms |
6492 KB |
Output is correct |
14 |
Correct |
2 ms |
6488 KB |
Output is correct |
15 |
Correct |
2 ms |
6492 KB |
Output is correct |
16 |
Correct |
2 ms |
6640 KB |
Output is correct |
17 |
Correct |
2 ms |
6624 KB |
Output is correct |
18 |
Correct |
2 ms |
6492 KB |
Output is correct |
19 |
Correct |
2 ms |
6488 KB |
Output is correct |
20 |
Correct |
1 ms |
6492 KB |
Output is correct |
21 |
Correct |
2 ms |
6492 KB |
Output is correct |
22 |
Correct |
2 ms |
6492 KB |
Output is correct |
23 |
Correct |
2 ms |
6492 KB |
Output is correct |
24 |
Correct |
2 ms |
6488 KB |
Output is correct |
25 |
Correct |
1 ms |
6492 KB |
Output is correct |
26 |
Correct |
1 ms |
6492 KB |
Output is correct |
27 |
Correct |
2 ms |
6488 KB |
Output is correct |
28 |
Correct |
2 ms |
6492 KB |
Output is correct |
29 |
Correct |
70 ms |
6696 KB |
Output is correct |
30 |
Correct |
44 ms |
6744 KB |
Output is correct |
31 |
Correct |
32 ms |
6624 KB |
Output is correct |
32 |
Correct |
20 ms |
6740 KB |
Output is correct |
33 |
Correct |
8 ms |
6748 KB |
Output is correct |
34 |
Correct |
31 ms |
6748 KB |
Output is correct |
35 |
Correct |
50 ms |
6740 KB |
Output is correct |
36 |
Correct |
16 ms |
6636 KB |
Output is correct |
37 |
Correct |
67 ms |
6980 KB |
Output is correct |
38 |
Correct |
66 ms |
6740 KB |
Output is correct |
39 |
Correct |
44 ms |
6740 KB |
Output is correct |
40 |
Correct |
24 ms |
6748 KB |
Output is correct |
41 |
Correct |
19 ms |
6628 KB |
Output is correct |
42 |
Correct |
21 ms |
6748 KB |
Output is correct |
43 |
Correct |
3 ms |
6744 KB |
Output is correct |
44 |
Correct |
5 ms |
6748 KB |
Output is correct |
45 |
Correct |
5 ms |
6752 KB |
Output is correct |
46 |
Correct |
9 ms |
6744 KB |
Output is correct |
47 |
Correct |
26 ms |
6492 KB |
Output is correct |
48 |
Correct |
29 ms |
6492 KB |
Output is correct |
49 |
Correct |
38 ms |
6740 KB |
Output is correct |
50 |
Correct |
40 ms |
6744 KB |
Output is correct |
51 |
Correct |
21 ms |
6748 KB |
Output is correct |
52 |
Correct |
26 ms |
6740 KB |
Output is correct |
53 |
Correct |
35 ms |
6740 KB |
Output is correct |
54 |
Correct |
48 ms |
7000 KB |
Output is correct |
55 |
Execution timed out |
2031 ms |
14684 KB |
Time limit exceeded |
56 |
Halted |
0 ms |
0 KB |
- |