結果

問題 No.231 めぐるはめぐる (1)
ユーザー pekempeypekempey
提出日時 2015-06-26 22:32:08
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 775 bytes
コンパイル時間 1,273 ms
コンパイル使用メモリ 149,020 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-07 18:35:18
合計ジャッジ時間 2,133 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define all(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;

int N;
ll G[1000], D[1000];
pair<ll, int> EXP[1000];

int main() {
    cin >> N;
    rep (i, N) cin >> G[i] >> D[i];
    rep (i, N) EXP[i] = make_pair(G[i] - 30000 * D[i], i + 1);

    sort(EXP, EXP + N);

    ll sum = EXP[N - 1].first * 6;

    if (sum >= 100 * 30000) {
        cout << "YES" << endl;
        rep (i, 6) cout << EXP[N - 1].second << endl;
    } else {
        cout << "NO" << endl;
    }
}
0