結果
問題 | No.750 Frac #1 |
ユーザー |
👑 |
提出日時 | 2019-09-25 16:01:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 492 bytes |
コンパイル時間 | 841 ms |
コンパイル使用メモリ | 77,512 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 07:28:35 |
合計ジャッジ時間 | 1,933 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef pair<int,int> Paint; bool bunsu(const Paint&pf, const Paint&ps){ return pf.first*ps.second > ps.first*pf.second; } int main(){ int n;cin>>n; vector<Paint> a; for(int i = 0; n > i; i++){ int x,y;cin>>x>>y; a.push_back(make_pair(x,y)); } sort(a.begin(),a.end(),bunsu); for(int i = 0; n > i; i++){ cout << a[i].first << " " << a[i].second << endl; } }