結果
問題 | No.750 Frac #1 |
ユーザー |
![]() |
提出日時 | 2020-04-27 20:21:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 1,788 ms |
コンパイル使用メモリ | 175,700 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-22 06:58:23 |
合計ジャッジ時間 | 2,931 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; vector<pair<double, pair<int, int>>> X(N); for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; X[i] = make_pair((double)a / b, make_pair(a, b)); } sort(X.begin(), X.end()); reverse(X.begin(), X.end()); for (int i = 0; i < N; i++) { cout << X[i].second.first << ' ' << X[i].second.second << '\n'; } return 0; }