[Codeforces Round #429 (Div.1)] 840A – Leha and Function

发布于 2017-08-19  11 次阅读



题目(Codeforces)
规律嘛......
A中最大的与B中最小的组合,A中第二大的与B中第二小的组合......
总之,每一组都要让B[i]/A[i]最小
OK。

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>
typedef long long ll;
using namespace std;
struct node{
	int id,w;
}b[200005];
int m,a[200005],ans[200005];
bool cmp(const node &a,const node &b)
{
	return a.w>b.w;
}
int main(){
	scanf(
	for (int i=1;i<=m;i++){
		scanf(
	}
	for (int i=1;i<=m;i++){
		scanf(
		b[i].id=i;
	}
	sort(b+1,b+m+1,cmp);
	sort(a+1,a+m+1);
	for (int i=1;i<=m;i++){
		ans[b[i].id]=a[i];
	}
	for (int i=1;i<=m;i++){
		printf(
	}
	return 0;
}