Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
26557143 Out of competition:
* mjhun
798D - 9 C++14 (GCC 6-32) Accepted 436 ms 3848 KB 2017-04-21 18:47:05 2017-04-21 20:17:08
→ Source
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i)
using namespace std;
typedef long long ll;

pair<pair<int,int>,int> x[100005];
int n;
ll sa,sb;
int as[100005],bs[100005];

bool valid(){
	ll a=0,b=0;
	fore(i,0,n/2+1)a+=x[i].fst.fst,b+=x[i].fst.snd;
	return 2*a>sa&&2*b>sb;
}

int main(){
	scanf("%d",&n);
	fore(i,0,n)scanf("%d",as+i),sa+=as[i];
	fore(i,0,n)scanf("%d",bs+i),sb+=bs[i];
	fore(i,0,n)x[i]=mp(mp(as[i],bs[i]),i);
	while(!valid())random_shuffle(x,x+n);
	printf("%d\n",n/2+1);
	fore(i,0,n/2+1){
		if(i)putchar(' ');
		printf("%d",x[i].snd+1);
	}
	puts("");
	return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details