QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#860473#9975. Hitoshizukuucup-team4717#WA 49ms5968kbC++14717b2025-01-18 13:34:462025-01-18 13:34:46

Judging History

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

  • [2025-01-18 13:34:46]
  • 评测
  • 测评结果:WA
  • 用时:49ms
  • 内存:5968kb
  • [2025-01-18 13:34:46]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define N 300005
using namespace std;
int T;
int n;
int A[N],B[N],C[N];
struct node{
    int a,b,id;
}t[N],g[N];
bool cmp(node x,node y){return x.b<y.b;}
void sol(){
    scanf("%lld",&n);
    for(int i=1;i<=n*3;i++) scanf("%lld %lld",&t[i].a,&t[i].b),t[i].id=i;
    sort(t+1,t+n*3+1,cmp);
    for(int i=1;i<=n*3;i+=3){
        if(t[i].a>t[i+1].b||t[i].a>t[i+2].b||t[i+1].a>t[i].b||t[i+1].a>t[i+2].b||t[i+2].a>t[i].b||t[i+2].a>t[i+1].b){printf("No");return;}
    }
    printf("Yes\n");
    for(int i=1;i<=n*3;i+=3) printf("%lld %lld %lld\n",t[i].id,t[i+1].id,t[i+2].id);
}
signed main(){
    scanf("%lld",&T);
    while(T--) sol();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 5968kb

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: 49ms
memory: 5960kb

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:

NoNoNoYes
1 3 2
NoYes
2 1 3
NoNoNoNoNoYes
2 1 3
Yes
1 2 3
NoNoNoNoYes
2 3 1
NoYes
2 3 1
NoNoYes
2 3 1
NoNoYes
3 1 2
NoNoNoNoNoNoNoYes
3 2 1
NoNoYes
3 2 1
NoNoNoNoNoNoNoNoNoNoNoNoYes
3 2 1
NoNoYes
2 3 1
Yes
3 2 1
NoNoYes
2 1 3
NoNoNoYes
1 2 3
Yes
3 2 1
NoYes
3 2 1
Yes
1 2 3
Yes
2 1 3
Yes
3 2 1
NoYes
...

result:

wrong answer Token parameter [name=yesno] equals to "NoNoNoYes", doesn't correspond to pattern "(Yes)|(No)" (test case 1)