結果
| 問題 |
No.750 Frac #1
|
| コンテスト | |
| ユーザー |
gazelle
|
| 提出日時 | 2018-11-09 21:23:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 1,000 ms |
| コード長 | 941 bytes |
| コンパイル時間 | 1,130 ms |
| コンパイル使用メモリ | 108,924 KB |
| 最終ジャッジ日時 | 2025-01-06 15:56:21 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<iomanip>
#include<math.h>
#include<bitset>
#include<cassert>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007LL
#define INF 1000000000LL
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<pair<ld,P>> a(n);
REP(i,n) cin >> a[i].second.first >> a[i].second.second;
REP(i,n) a[i].first = a[i].second.first / (ld)a[i].second.second;
sort(ALL(a));
for(ll i = n - 1; i >= 0; i--) {
cout << a[i].second.first << " " << a[i].second.second << endl;
}
return 0;
}
gazelle