結果

問題 No.322 Geometry Dash
ユーザー kimiyukikimiyuki
提出日時 2016-02-28 22:22:58
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 747 bytes
コンパイル時間 973 ms
コンパイル使用メモリ 66,660 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 18:54:14
合計ジャッジ時間 5,852 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;
template <class T> istream & operator >> (istream & in, vector<T> & a) { for (T & it : a) in >> it; return in; }
template <class T> ostream & operator << (ostream & out, vector<T> const & a) { bool i = false; for (T const & it : a) { if (i) out << ' '; else i = true; out << it; } return out; }
int main() {
    int n; cin >> n;
    vector<int> t(n), d(n); cin >> t >> d;
    vector<int> xs(n); repeat (i,n) xs[i] = i;
    sort(xs.begin(), xs.end(), [&](int i, int j) { return make_pair(d[i] * t[j], - t[i]) < make_pair(d[j] * t[i], - t[j]); });
    repeat (i,n) ++ xs[i];
    cout << xs << endl;
    return 0;
}
0