QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#266811 | #7750. Revenge on My Boss | qkm66666# | WA | 16ms | 5336kb | C++17 | 1.7kb | 2023-11-26 17:57:08 | 2023-11-26 17:57:09 |
Judging History
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 a[100005],b[100005],c[100005];
int main()
{
int T=reaD();
while(T--)
{
int n=reaD();
long long s=0;
for(int i=1;i<=n;i++)
{
a[i]=read(),b[i]=read(),c[i]=read();
s+=min(a[i],b[i]);
}
for(int i=1;i<=n;i++)
{
if(a[i]<=b[i])A.pb(mp(c[i]*s+c[i]*max(a[i],b[i]),i));
else B.pb(mp(-(c[i]*s+c[i]*max(a[i],b[i])),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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3912kb
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 7 9 1 6
result:
ok correct
Test #2:
score: -100
Wrong Answer
time: 16ms
memory: 5336kb
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:
32063 35138 77895 37175 1117 78892 13855 93403 57307 43882 10790 40485 75847 86508 16681 30921 37548 74098 71155 60433 22241 74378 28602 30951 65092 98171 260 71472 73404 2098 26268 89359 83373 57 41825 24139 11373 63971 45598 22777 41079 27203 79576 94828 67086 63986 84460 6652 82720 32084 87144 88...
result:
wrong answer Wrong Answer on Case#1