結果
| 問題 |
No.322 Geometry Dash
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-12 20:05:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 762 bytes |
| コンパイル時間 | 2,015 ms |
| コンパイル使用メモリ | 174,932 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-18 07:13:25 |
| 合計ジャッジ時間 | 6,173 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
vector<tuple<int,int,int>> a(N);
for(int i = 0; i < N; i++) {
cin >> get<0>(a[i]);
get<0>(a[i]) *= 2;
}
for(int i = 0; i < N; i++){
cin >> get<1>(a[i]);
get<2>(a[i]) = i + 1;
}
sort(a.begin(), a.end(), [&](tuple<int,int,int> lhs, tuple<int,int,int> rhs){
return get<0>(lhs) / 2 * get<1>(lhs) + (get<0>(lhs) + get<0>(rhs) / 2) * get<1>(rhs)
> get<0>(rhs) / 2 * get<1>(rhs) + (get<0>(rhs) + get<0>(lhs) / 2) * get<1>(lhs);
});
for(int i = 0; i < N; i++){
cout << get<2>(a[i]) << (i + 1 == N ? '\n' : ' ');
}
}