結果

問題 No.322 Geometry Dash
ユーザー roaris
提出日時 2019-12-11 23:33:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 1,753 ms
コンパイル使用メモリ 177,536 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 08:07:56
合計ジャッジ時間 7,680 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef tuple<int, int, int> T;

int main() {
    int N; cin >> N;
    int t[N], d[N];
    
    for (int i=0; i<N; i++) cin >> t[i];
    for (int i=0; i<N; i++) cin >> d[i];
    
    vector<T> TD;
    
    for (int i=0; i<N; i++) {
        TD.push_back(make_tuple(i, t[i], d[i]));
    }
    
    sort(TD.begin(), TD.end(), [](const auto &lhs, const auto &rhs) {return get<1>(lhs)*get<2>(rhs)>get<1>(rhs)*get<2>(lhs);});
    
    for (int i=0; i<N-1; i++) {
        cout << get<0>(TD[i])+1 << " ";
    }
    cout << get<0>(TD[N-1])+1 << endl;
}
0