結果
| 問題 |
No.750 Frac #1
|
| コンテスト | |
| ユーザー |
YDK1727
|
| 提出日時 | 2018-11-09 21:51:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,862 bytes |
| コンパイル時間 | 1,807 ms |
| コンパイル使用メモリ | 170,732 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 05:51:54 |
| 合計ジャッジ時間 | 2,623 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include "bits/stdc++.h" // {{{
using namespace std;
#define eb emplace_back
#define emp emplace
#define fi first
#define se second
#define X first
#define Y second
#define outl(x) cout << (x) << '\n'
#define rep(i,n) for(int i=0; i < (int)(n); ++i)
#define ALL(x) begin(x), end(x)
#define TMPLT(T,U) template<class T, class U>
#define ten(p) (int)(1e##p)
#define FILL(a,val) memset((a), (val), sizeof(a))
#define FAST() ios::sync_with_stdio(false), cin.tie(nullptr)
#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define show(x) clog << #x << " \t= " << (x) << '\n'
#define line() fputs("\n--------------------------------\n", stderr)
#else
#define debug(...)
#define show(x)
#define LN()
#endif
using ll = long long;
using pii = pair<int,int>;
TMPLT(T,U) inline bool chmax(T &a, U b){return b>a ? a=b,1 : 0;}
TMPLT(T,U) inline bool chmin(T &a, U b){return b<a ? a=b,1 : 0;}
TMPLT(T,U) inline constexpr common_type_t<T,U> gcd(T x, U y) { return (x<y)? gcd(y,x) : (y <= 0)? x : gcd(y, x % y); }
TMPLT(T,U) inline constexpr ll lcm(T x, U y) { return (ll)x/gcd(x,y) * y; }
inline bool inner(int val, int min, int max){ return min <= val && val < max; }
constexpr int INF = 0x3f3f3f3f;
constexpr ll LINF = 0x3f3f3f3f3f3f3f3fLL;
namespace ydk{ // }}}
constexpr int MXN = ten(5) + 10;
signed _vim_is_god_()
{
int n;
pii a[100];
cin >> n;
rep(i, n) {
int x, y;
cin >> x >> y;
a[i] = pii(x, y);
}
sort(a, a+n, [](const pii &a, const pii &b) {
return (double)a.fi / a.se > (double)b.fi / b.se;
});
rep(i, n) {
cout << a[i].fi << ' ' << a[i].se << endl;
}
return 0;
}
} // {{{
signed main(){cout << fixed << setprecision(9); ydk::_vim_is_god_(); return 0;} // }}}
YDK1727