結果
問題 | No.750 Frac #1 |
ユーザー |
![]() |
提出日時 | 2018-12-30 14:39:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 801 bytes |
コンパイル時間 | 1,010 ms |
コンパイル使用メモリ | 103,420 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-07 06:28:40 |
合計ジャッジ時間 | 2,146 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <set> #include <cmath> #include <stack> #include <algorithm> #include <iomanip> #include <map> #include <queue> #include <functional> #include <numeric> using ll = long long; using namespace std; const ll MOD = 1e9 + 7; vector<pair<double, double>> vp; vector<double> v; bool comp(const pair<double, double> &a, const pair<double, double> &b) { return a.first * b.second < b.first * a.second; } int main(void) { int N; cin >> N; for (int i = 0; i < N; ++i) { double a, b; cin >> a >> b; vp.push_back({a, b}); } sort(vp.begin(), vp.end(), comp); reverse(vp.begin(), vp.end()); for (auto e : vp) cout << e.first << " " << e.second << endl; return 0; }