結果

問題 No.750 Frac #1
コンテスト
ユーザー forest3
提出日時 2020-03-12 16:31:56
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 273µs
コード長 390 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,068 ms
コンパイル使用メモリ 194,620 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-09-25 21:48:48
合計ジャッジ時間 3,307 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<tuple<double, int, int>> d( n );
	for( int i = 0; i < n; i++ ) {
		int A, B;
		cin >> A >> B;
		d[i] = make_tuple( (double)A / B, A, B );
	}

	sort( d.begin(), d.end(), greater<tuple<double, int, int>>() );
	for( int i = 0; i < n; i++ ) {
		cout << get<1>( d[i] ) << " " << get<2>( d[i] ) << endl;
	}
}
0