CodeVS 4181 三体之期望执剑人 【排序】

tonyfang posted @ 2015年9月22日 16:33 in codevs with tags C++ OI , 646 阅读



# include <stdio.h>
# include <algorithm>
using namespace std;
struct people {
	int a,b;
int n;
inline int cmp(struct people s,struct people t) {
	return s.a<t.a || (s.a==t.a&&s.b>t.b);
int main() {
	for (int i=1;i<=n;++i) scanf("%d",&p[i].a);
	for (int i=1;i<=n;++i) scanf("%d",&p[i].b);
	bool f=1;
	while(f) {
		int ans=0;
		for (int i=2;i<=n;++i)
			if(p[i-1].a==p[i].a||p[i].b<=p[i-1].b) p[++ans]=p[i-1];
			else f=1;
	return 0;
https://pucresult201 说:
2023年4月15日 22:38

Pucresult 2023 is a start-up by passionate webmasters and bloggers who have a passion to provide engaging content which is accurate, interesting, and worthy to read. We are more like a web community where you can find different information, resources, and topics on day-to-day incidents or news. We provide you the finest of web content on each and every topic possible with help of an editorial and content team Our site is a multiple Niche or category website which will ensure to provide informational and resources on each and every topic.

登录 *

loading captcha image...
or Ctrl+Enter