結果
| 問題 |
No.231 めぐるはめぐる (1)
|
| コンテスト | |
| ユーザー |
vain0
|
| 提出日時 | 2015-06-26 22:52:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,330 bytes |
| コンパイル時間 | 822 ms |
| コンパイル使用メモリ | 80,720 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 18:14:10 |
| 合計ジャッジ時間 | 2,755 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 9 |
ソースコード
#include <cassert>
#include <functional>
#include <set>
#include <ctime>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <queue>
#include <map>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#ifndef ONLINE_JUDGE //POJ
# include <complex>
# include <random>
# include <array>
# define mkt make_tuple
# define empb emplace_back
#endif
#ifdef _LOCAL
# include "for_local.h"
#endif
using namespace std;
typedef unsigned int uint; typedef long long ll; typedef unsigned long long ull;
#define repi(_I, _B, _E) for(int _I = (_B); (_I) < (_E); ++ (_I))
#define rep(_I, _N) for(int _I = 0; (_I) < (_N); ++ (_I))
#define mkp make_pair
#define all(_X) (_X).begin(), (_X).end()
int val[1000];
int dun[6];
int const Need = 3000000;
int const Penalty = Need/100;
signed main() {
int n;
cin >> n;
rep(i, n) {
int g, d;
cin >> g >> d;
val[i] = g - Penalty * d;
}
sort(val, val + n, std::greater<int>());
bool ok = false;
int ex = 0;
repi(k, 1, 6) { //重複度
rep(j, 6) {
int const i = j % (6 / k);
if ( i >= n ) { ex = 0; break; }
ex += val[i];
dun[j] = i;
}
if ( ex >= Need ) { ok = true; break; }
}
if ( ok ) {
cout << "YES" << endl;
rep(i, 6) {
cout << (dun[i] + 1) << endl;
}
} else {
cout << "NO" << endl;
}
return 0;
}
vain0