QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#864521#9975. HitoshizukugggggggWA 47ms3840kbC++14789b2025-01-20 18:00:162025-01-20 18:00:27

Judging History

你现在查看的是最新测评结果

  • [2025-01-20 18:00:27]
  • 评测
  • 测评结果:WA
  • 用时:47ms
  • 内存:3840kb
  • [2025-01-20 18:00:16]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define sz(x) ((int)x.size())
#define ll long long
#define LL __int128
using namespace std;
using pii=pair<ll,ll>;
using tup=tuple<int,int,int>;
const int N=300005;
int n;
struct T{
    int l,r,id;
    bool operator<(const T&o)const{
        return r<o.r;
    }
}a[N];
void solve(){
    scanf("%d",&n);
    rep(i,1,3*n) scanf("%d%d",&a[i].l,&a[i].r),a[i].id=i;
    sort(a+1,a+3*n+1);
    for(int i=1;i<=3*n;i+=3){
        if(a[i].r<a[i+2].l) return puts("No"),void();
    }
    puts("Yes");
    for(int i=1;i<=3*n;i+=3) printf("%d %d %d\n",a[i].id,a[i+1].id,a[i+2].id);
}
int main(){
    int T;
    scanf("%d",&T);
    while(T--) solve();    
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3840kb

input:

2
2
1 2
2 2
2 3
3 5
4 4
4 5
1
1 1
1 1000000000
1000000000 1000000000

output:

Yes
1 2 3
5 4 6
No

result:

ok >_< (2 test cases)

Test #2:

score: -100
Wrong Answer
time: 47ms
memory: 3840kb

input:

100000
1
164154503 167959139
178382610 336470888
12298535 642802746
1
165064830 773386884
353585658 396628655
792066242 971207868
1
1607946 2087506
21674839 46761498
9518201 16843338
1
262361007 691952768
190585553 787375312
637191526 693319712
1
41970708 45277106
197619816 762263554
308360206 40724...

output:

Yes
1 2 3
No
No
Yes
1 3 2
No
Yes
2 1 3
No
No
No
No
No
Yes
2 1 3
Yes
1 2 3
No
No
No
No
Yes
2 3 1
No
Yes
2 3 1
No
No
Yes
2 3 1
No
No
Yes
3 1 2
No
No
Yes
1 2 3
No
Yes
2 1 3
No
No
Yes
3 2 1
No
No
Yes
3 2 1
No
No
Yes
2 1 3
No
No
No
Yes
2 1 3
No
No
No
No
No
Yes
3 2 1
No
No
Yes
2 3 1
Yes
3 2 1
No
Yes
1 3 2...

result:

wrong answer There is no valid answer, but participant found one. (test case 1)