結果
問題 | No.322 Geometry Dash |
ユーザー |
![]() |
提出日時 | 2016-01-08 14:01:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 65 ms / 2,000 ms |
コード長 | 1,190 bytes |
コンパイル時間 | 1,749 ms |
コンパイル使用メモリ | 161,772 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 18:50:53 |
合計ジャッジ時間 | 6,822 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h>using namespace std;#undef _P#define _P(...) (void)printf(__VA_ARGS__)#define FOR(i,a,b) for (int i = (a); i < (b); i++)#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); i--)#define REP(i,n) for (int i = 0; i < (n); i++)#define RREP(i,n) for (int i = (n)-1; i >= 0; i--)#define ALL(x) (x).begin(), (x).end()#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)template<class T> inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }template<class T> inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }typedef long long ll;// -------------------------------------typedef pair<int, pair<int, int> > PIII;int N;PIII S[100010];int cmp(PIII lhs, PIII rhs) {return rhs.second.first * lhs.second.second < lhs.second.first * rhs.second.second;}int main() {cin >> N;REP(i, N) {S[i].first = i + 1;cin >> S[i].second.first;}REP(i, N) cin >> S[i].second.second;sort(S, S+N, cmp);REP(i, N) {if (i > 0) cout << ' ';cout << S[i].first;}cout << '\n';return 0;}