結果
問題 | No.750 Frac #1 |
ユーザー |
|
提出日時 | 2018-11-09 21:40:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 78,912 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 05:44:24 |
合計ジャッジ時間 | 1,607 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int n; cin >> n; vector<pair<double,int>> v; int a[n], b[n]; for(int i = 0; i < n; i++){ cin >> a[i] >> b[i]; v.push_back({(double)(a[i])/b[i], i}); } sort(v.rbegin(), v.rend()); for(pair<double,int> p : v) cout << a[p.second] << " " << b[p.second] << endl; return 0; }