QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#270004#7750. Revenge on My BossHayasaWA 19ms4752kbC++20741b2023-11-30 13:40:082023-11-30 13:40:09

Judging History

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

  • [2023-11-30 13:40:09]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:4752kb
  • [2023-11-30 13:40:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

void solve(){
	int n;
	cin>>n;
	struct node{
		int a,b,c,id;
		bool operator <(const node &_)const{
			if(a<b&&_.a<_.b)return c<_.c;
			if(a<b&&_.a>=_.b)return 1;
			if(a>b&&_.a<=_.b)return 0;
			if(a>b&&_.a>_.b)return c>_.c;
			return 0;
		}
	};
	vector<node>P(n);

	int ans;
	int sa=0,sb=0;
	for(int i=0;i<n;++i){
		int a,b,c;
		cin>>a>>b>>c;
		P[i]={a,b,c,i};
		sb+=b;
	}
	sort(P.begin(),P.end());
	for(int i=0;i<n;++i)cout<<P[i].id+1<<" ";
	cout<<"\n";
//	for(int i=0;i<n;++i){
//		sa+=P[i].a;
//		if(i==0||ans<(sa+sb)*P[i].c)
//			ans=(sa+sb)*P[i].c;
//		sb-=P[i].b;
//	}
//	cout<<ans<<"\n";
}
	
int main(){
	cin.tie(nullptr)->sync_with_stdio(false);
	int T;
	cin>>T;
	while(T--)solve();
}

詳細信息

Test #1:

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

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: 19ms
memory: 4752kb

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:

57818 82423 82422 57820 35047 35048 82420 35050 35051 82419 35053 35055 82417 35043 35058 71065 35060 35061 35062 82414 35064 57816 82412 35067 82411 82409 35029 35015 35016 82437 35018 35019 57826 35021 35022 35024 82434 35026 35027 82408 82431 82430 82429 82428 82427 57821 35038 35039 82424 35041 ...

result:

wrong answer Wrong Answer on Case#1