QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#266762#7750. Revenge on My Bossqkm66666#WA 12ms4144kbC++171.5kb2023-11-26 17:28:382023-11-26 17:28:39

Judging History

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

  • [2023-11-26 17:28:39]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:4144kb
  • [2023-11-26 17:28:38]
  • 提交

answer

#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cassert>
#include<cstdio>
#include<cctype>
#include<vector>
#include<bitset>
#include<random>
#include<ctime>
#include<queue>
#include<cmath>
#include<list>
#include<map>
#include<set>
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long,long long>
#define FF fflush(stdout)
#define inf 0x3f3f3f3f
#define endl "\n"
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
//char buf[1<<20],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline int read()
{
    int s=0,f=1;
    char x=getchar();
    while(!isdigit(x))f=(x=='-'?-1:1),x=getchar();
    while(isdigit(x))s=s*10+x-'0',x=getchar();
    return s*f;
}
const int p=1e9+7;
//ll ksm(int a,int b){ll ans=1,bs=a;while(b){if(b&1)ans=ans*bs%p;bs=bs*bs%p;b>>=1;}return ans;}
mt19937 rd(time(0));
#define reaD read
vector<pii> A,B;
int main()
{
    int T=reaD();
    while(T--)
    {
        int n=reaD();
        for(int i=1;i<=n;i++)
        {
            int a=read(),b=read(),c=reaD();
            if(a<=b)A.pb(mp(c,i));
            else B.pb(mp(-c,i));
        }
        sort(A.begin(),A.end());
        sort(B.begin(),B.end());
        for(auto i:A)printf("%d ",i.se);
        for(auto i:B)printf("%d ",i.se);
        puts("");
        A.clear(),B.clear();
    }
    //system("pause");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
4
1 1 4
5 1 5
1 9 1
9 8 1
9
3 1 4
1 5 9
2 6 5
3 5 8
9 7 9
3 2 3
8 4 6
2 6 8
3 2 7

output:

3 1 2 4 
3 4 8 2 5 9 7 1 6 

result:

ok correct

Test #2:

score: -100
Wrong Answer
time: 12ms
memory: 4144kb

input:

1
100000
581297 102863 1
742857 42686 1
676710 233271 1
443055 491162 1
442056 28240 1
769277 331752 1
8608 369730 1
495112 525554 1
787449 938154 1
441186 850694 1
84267 925450 1
740811 32385 1
834021 37680 1
257878 564126 1
90618 914340 1
239641 463103 1
40687 343062 1
587737 458554 1
103684 48666...

output:

4 7 8 9 10 11 14 15 16 17 19 20 22 23 25 26 29 30 34 35 36 37 39 41 42 44 45 47 48 49 50 51 52 54 55 56 57 58 63 64 65 67 68 73 75 77 81 83 85 87 91 97 98 99 102 103 104 105 107 109 110 112 113 114 116 118 119 120 123 124 126 127 128 130 134 137 140 141 143 145 146 150 151 153 155 159 160 164 166 16...

result:

wrong answer Wrong Answer on Case#1