結果
問題 | No.322 Geometry Dash |
ユーザー |
![]() |
提出日時 | 2015-12-11 03:10:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 66 ms / 2,000 ms |
コード長 | 639 bytes |
コンパイル時間 | 1,473 ms |
コンパイル使用メモリ | 163,284 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 10:47:51 |
合計ジャッジ時間 | 7,483 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
#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 << " ";}}