結果
問題 | No.750 Frac #1 |
ユーザー |
|
提出日時 | 2018-11-09 21:21:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 1,563 ms |
コンパイル使用メモリ | 173,568 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 05:23:26 |
合計ジャッジ時間 | 2,477 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n)for(int i=0;i<(n);i++)using namespace std;typedef pair<int,int>P;int main(){int n;scanf("%d",&n);vector<P>v;rep(i,n){int a,b;cin>>a>>b;v.push_back(P(a,b));}sort(v.begin(),v.end(),[](P a,P b){return a.first/(double)a.second>b.first/(double)b.second;});for(auto p:v){cout<<p.first<<' '<<p.second<<endl;}}