QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#568083 | #9310. Permutation Counting 4 | zny780624 | WA | 0ms | 3728kb | C++20 | 1.0kb | 2024-09-16 15:10:51 | 2024-09-16 15:10:51 |
Judging History
answer
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<bitset>
#include<cstring>
#include<queue>
#define fst first
#define sec second
using namespace std;
using ll=long long;
typedef pair<int,int>pii;
const int N=1e6+10;
ll f[N];
int find(ll a)
{
return a==f[a]?a:find(f[a]);
}
void Silverwolf(){
int n,l,r,y=1;
cin>>n;
for(int i=1;i<=n;i++)f[i]=i;
for(int i=1;i<=n;i++)
{
cin>>l>>r;
int fl=find(l);
int fr=find(r+1);
if(fl==fr)
{
y=0;
break;
}
}
if(y)cout<<1<<endl;
else cout<<0<<endl;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;cin>>T;while(T--)
Silverwolf();
//愿艾利欧三度为你窥见,令你的生命永不停歇,骇入永远成功,游戏永远胜利。
//游戏就只是为了游戏,仅此而已
//acm这种东西,三两下搞定就好啦
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3728kb
input:
4 5 1 2 1 5 1 2 1 2 2 2 5 1 1 2 4 2 3 5 5 3 4 5 3 5 1 2 3 4 3 5 3 3 5 1 5 1 4 4 5 5 5 1 2
output:
1 1 1 1
result:
wrong answer 1st words differ - expected: '0', found: '1'