結果

問題 No.322 Geometry Dash
ユーザー ctyl_0
提出日時 2015-12-16 03:17:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 1,179 bytes
コンパイル時間 1,625 ms
コンパイル使用メモリ 90,168 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 18:06:21
合計ジャッジ時間 7,175 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define var auto
#define mod 1000000007
#define inf 2147483647
#define nil -1
#define mp make_pair
typedef long long ll;
using namespace std;

template <typename T>
inline void output(T a, int p) {
    if(p){
        cout << fixed << setprecision(p)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}
// end of template

bool Comp(pair<pair<int, int>, int> x, pair<pair<int, int>, int> y){
    return x.first.first * y.first.second > x.first.second * y.first.first;
}

int main() {
    cin.tie(0);
    // source code
    int N;
    cin >> N;
    vector<pair<pair<int, int>, int>> A(N);
    rep(i, N) cin >> A[i].first.first;
    rep(i, N) cin >> A[i].first.second;
    rep(i, N) A[i].second = i + 1;
    sort(A.begin(), A.end(), Comp);
    rep(i, N){
        if (i) cout << " ";
        cout << A[i].second;
    }
    cout << endl;
    
    return 0;
}
0