結果
| 問題 |
No.322 Geometry Dash
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-15 10:28:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 795 bytes |
| コンパイル時間 | 1,912 ms |
| コンパイル使用メモリ | 160,224 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 16:58:58 |
| 合計ジャッジ時間 | 6,301 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
コンパイルメッセージ
main.cpp: In function ‘void RI(int&, T& ...) [with T = {}]’:
main.cpp:15:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%d",&head);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define FORD(x,y,z) for(int x=y;x>=z;x--)
#define MSET(x,y) memset(x,y,sizeof(x))
#define FOR(x,y) for(__typeof(y.begin()) x=y.begin();x!=y.end();x++)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 100005
void RI(){}
template<typename... T>
void RI( int& head, T&... tail ) {
scanf("%d",&head);
RI(tail...);
}
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
int n;
int in1[M],in2[M],ord[M];
int main()
{
while(~scanf("%d",&n))
{
REP(i,1,n) RI(in1[i]);
REP(i,1,n) RI(in2[i]);
REP(i,1,n) ord[i]=i;
sort(ord+1,ord+1+n,[](int a,int b){ return in1[a]*in2[b]>in1[b]*in2[a]; }) ;
REP(i,1,n) printf("%d ",ord[i]); puts("");
}
return 0;
}