結果

問題 No.322 Geometry Dash
コンテスト
ユーザー piyoko_212
提出日時 2015-12-21 14:13:19
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 503 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 426 ms
コンパイル使用メモリ 56,704 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-08 20:39:18
合計ジャッジ時間 3,843 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
#include<algorithm>
using namespace std;
int p[210000];
int q[210000];
struct st{
	int t,d;
	int id;
	st(){}
};
inline bool operator<(const st &a,const st &b){
	return a.t*b.d>a.d*b.t;
}
st r[210000];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",p+i);
	for(int i=0;i<a;i++)scanf("%d",q+i);
	for(int i=0;i<a;i++){
		r[i].t=p[i];
		r[i].d=q[i];
		r[i].id=i+1;
	}
	std::sort(r,r+a);
	for(int i=0;i<a;i++){
		if(i)printf(" ");printf("%d",r[i].id);
	}
	printf("\n");
}
0