結果

問題 No.322 Geometry Dash
ユーザー kotatsugamekotatsugame
提出日時 2020-03-01 04:29:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 76,400 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 20:27:50
合計ジャッジ時間 6,386 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
int T[1<<17],D[1<<17];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>T[i];
	for(int i=0;i<N;i++)cin>>D[i];
	vector<pair<pair<int,int>,int> >A(N);
	for(int i=0;i<N;i++)
	{
		A[i].first.first=T[i];
		A[i].first.second=D[i];
		A[i].second=i+1;
	}
	sort(A.begin(),A.end(),[](pair<pair<int,int>,int>a,pair<pair<int,int>,int>b)
	{
		return a.first.first*b.first.second>a.first.second*b.first.first;
	});
	for(int i=0;i<N;i++)cout<<A[i].second<<(i+1==N?'\n':' ');
}
0