結果
問題 | No.750 Frac #1 |
ユーザー |
|
提出日時 | 2020-06-04 21:59:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 1,000 ms |
コード長 | 392 bytes |
コンパイル時間 | 1,084 ms |
コンパイル使用メモリ | 79,916 KB |
最終ジャッジ日時 | 2025-01-10 21:24:50 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<tuple> using namespace std; int main(){ int n;cin>>n; vector<pair<float,float>> ab(n); for(int i=0;i<n;++i)cin>>ab[i].first>>ab[i].second; sort(ab.begin(),ab.end(),[](auto x,auto y){return x.first/x.second>y.first/y.second;}); for(int i=0;i<n;++i)cout<<int(ab[i].first)<<" "<<int(ab[i].second)<<"\n"; }