結果

問題 No.322 Geometry Dash
ユーザー ichyoichyo
提出日時 2015-12-11 03:10:05
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 639 bytes
コンパイル時間 1,601 ms
コンパイル使用メモリ 163,424 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-25 22:41:06
合計ジャッジ時間 7,336 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 45 ms
6,940 KB
testcase_05 AC 47 ms
6,940 KB
testcase_06 AC 53 ms
6,944 KB
testcase_07 AC 55 ms
6,940 KB
testcase_08 AC 58 ms
6,944 KB
testcase_09 AC 47 ms
6,940 KB
testcase_10 AC 50 ms
6,944 KB
testcase_11 AC 54 ms
6,944 KB
testcase_12 AC 58 ms
6,944 KB
testcase_13 AC 60 ms
6,940 KB
testcase_14 AC 53 ms
6,940 KB
testcase_15 AC 55 ms
6,940 KB
testcase_16 AC 57 ms
6,940 KB
testcase_17 AC 61 ms
6,944 KB
testcase_18 AC 63 ms
6,940 KB
testcase_19 AC 55 ms
6,944 KB
testcase_20 AC 57 ms
6,944 KB
testcase_21 AC 61 ms
6,944 KB
testcase_22 AC 63 ms
6,944 KB
testcase_23 AC 65 ms
6,940 KB
testcase_24 AC 58 ms
6,944 KB
testcase_25 AC 61 ms
6,940 KB
testcase_26 AC 64 ms
6,940 KB
testcase_27 AC 64 ms
6,940 KB
testcase_28 AC 66 ms
6,940 KB
testcase_29 AC 60 ms
6,944 KB
testcase_30 AC 65 ms
6,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> A(n), B(n);
    for(int i = 0; i < n; i++) {
        cin >> A[i];
    }
    for(int i = 0; i < n; i++) {
        cin >> B[i];
    }
    vector<int> answer(n);
    for(int i = 0; i < n; i++) {
        answer[i] = i;
    }
    sort(answer.begin(), answer.end(), [&](int i, int j){
            if(A[i] * B[j] != A[j] * B[i]) return A[i] * B[j] > A[j] * B[i];
            return A[i] > A[j];
            });
    for(int i = 0; i < n; i++) {
        cout << answer[i] + 1;
        if(i == n-1) cout << endl;
        else cout << " ";
    }
}
0