結果

問題 No.750 Frac #1
ユーザー gazellegazelle
提出日時 2018-11-09 21:23:00
言語 C++17
(gcc 12.2.0 + boost 1.81.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 941 bytes
コンパイル時間 1,049 ms
実行使用メモリ 3,576 KB
最終ジャッジ日時 2022-12-26 19:25:28
合計ジャッジ時間 2,522 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
3,452 KB
testcase_01 AC 1 ms
3,480 KB
testcase_02 AC 1 ms
3,572 KB
testcase_03 AC 2 ms
3,516 KB
testcase_04 AC 1 ms
3,560 KB
testcase_05 AC 2 ms
3,484 KB
testcase_06 AC 2 ms
3,512 KB
testcase_07 AC 1 ms
3,388 KB
testcase_08 AC 1 ms
3,392 KB
testcase_09 AC 2 ms
3,388 KB
testcase_10 AC 2 ms
3,488 KB
testcase_11 AC 2 ms
3,440 KB
testcase_12 AC 1 ms
3,560 KB
testcase_13 AC 1 ms
3,436 KB
testcase_14 AC 2 ms
3,576 KB
testcase_15 AC 1 ms
3,544 KB
testcase_16 AC 2 ms
3,576 KB
testcase_17 AC 2 ms
3,452 KB
testcase_18 AC 2 ms
3,436 KB
testcase_19 AC 2 ms
3,508 KB
testcase_20 AC 1 ms
3,484 KB
testcase_21 AC 2 ms
3,508 KB
testcase_22 AC 1 ms
3,436 KB
testcase_23 AC 1 ms
3,384 KB
testcase_24 AC 1 ms
3,388 KB
testcase_25 AC 1 ms
3,456 KB
testcase_26 AC 2 ms
3,492 KB
testcase_27 AC 1 ms
3,508 KB
testcase_28 AC 1 ms
3,452 KB
testcase_29 AC 1 ms
3,452 KB
testcase_30 AC 2 ms
3,508 KB
testcase_31 AC 2 ms
3,392 KB
testcase_32 AC 1 ms
3,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0