結果
問題 | No.750 Frac #1 |
ユーザー |
![]() |
提出日時 | 2018-11-09 21:22:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 648 ms |
コンパイル使用メモリ | 76,032 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 05:27:42 |
合計ジャッジ時間 | 1,566 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> a(n); for (int i = 0; i < n; i++) { cin >> a[i].first >> a[i].second; } sort(a.begin(), a.end(), [](auto a, auto b) { return (double)a.first / a.second > (double)b.first / b.second; }); for (int i = 0; i < n; i++) { cout << a[i].first << ' ' << a[i].second << endl; } return 0; }