結果

問題 No.322 Geometry Dash
コンテスト
ユーザー Nekosyndrome
提出日時 2015-12-15 10:28:48
言語 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
コード長 795 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,205 ms
コンパイル使用メモリ 178,432 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-08 19:32:46
合計ジャッジ時間 4,547 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define FORD(x,y,z) for(int x=y;x>=z;x--)
#define MSET(x,y) memset(x,y,sizeof(x))
#define FOR(x,y) for(__typeof(y.begin()) x=y.begin();x!=y.end();x++)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 100005
void RI(){}
template<typename... T>
void RI( int& head, T&... tail ) {
    scanf("%d",&head);
    RI(tail...);
}
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
int n;
int in1[M],in2[M],ord[M];
int main()
{
	while(~scanf("%d",&n))
	{
		REP(i,1,n) RI(in1[i]);
		REP(i,1,n) RI(in2[i]);
		REP(i,1,n) ord[i]=i;

		sort(ord+1,ord+1+n,[](int a,int b){ return in1[a]*in2[b]>in1[b]*in2[a]; }) ;

		REP(i,1,n) printf("%d ",ord[i]); puts("");
	}
	return 0;
}
0