結果

問題 No.322 Geometry Dash
ユーザー h_nosonh_noson
提出日時 2016-05-25 11:18:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 58,948 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 06:07:38
合計ジャッジ時間 5,040 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 32 ms
6,944 KB
testcase_05 AC 35 ms
6,948 KB
testcase_06 AC 38 ms
6,940 KB
testcase_07 AC 41 ms
6,944 KB
testcase_08 AC 41 ms
6,944 KB
testcase_09 AC 35 ms
6,940 KB
testcase_10 AC 36 ms
6,940 KB
testcase_11 AC 38 ms
6,940 KB
testcase_12 AC 40 ms
6,944 KB
testcase_13 AC 42 ms
6,944 KB
testcase_14 AC 38 ms
6,940 KB
testcase_15 AC 38 ms
6,944 KB
testcase_16 AC 40 ms
6,940 KB
testcase_17 AC 43 ms
6,940 KB
testcase_18 AC 44 ms
6,940 KB
testcase_19 AC 38 ms
6,944 KB
testcase_20 AC 40 ms
6,940 KB
testcase_21 AC 42 ms
6,944 KB
testcase_22 AC 44 ms
6,940 KB
testcase_23 AC 46 ms
6,940 KB
testcase_24 AC 40 ms
6,940 KB
testcase_25 AC 42 ms
6,940 KB
testcase_26 AC 45 ms
6,940 KB
testcase_27 AC 45 ms
6,940 KB
testcase_28 AC 46 ms
6,940 KB
testcase_29 AC 37 ms
6,940 KB
testcase_30 AC 39 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
main.cpp:23:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   23 |     rep (i,n) scanf("%d",t+i);
      |               ~~~~~^~~~~~~~~~
main.cpp:24:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   24 |     rep (i,n) scanf("%d",d+i);
      |               ~~~~~^~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

#define REP(i,s,e) for (i = s; i <= e; i++)
#define rep(i,n) REP (i,0,(int)(n)-1)
#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP (i,(int)(n)-1,0)
#define INF (int)1e8
#define MOD (int)1e9+7

typedef long long ll;

int t[100100], d[100100], ans[100100];

bool cmp(int i, int j) {
    return t[j] * d[i] < t[i] * d[j];
}

int main(void) {
    int i, n;
    scanf("%d",&n);
    rep (i,n) scanf("%d",t+i);
    rep (i,n) scanf("%d",d+i);
    rep (i,n) ans[i] = i;
    sort(ans,ans+n,cmp);
    rep (i,n) printf("%d%c",ans[i]+1,i<n-1?' ':'\n');
    return 0;
}
0