結果

問題 No.750 Frac #1
ユーザー rusekiso
提出日時 2018-11-10 00:34:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 626 bytes
コンパイル時間 678 ms
コンパイル使用メモリ 79,136 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 08:18:18
合計ジャッジ時間 1,722 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <string.h>
#include <math.h>
#include <map>
#include <time.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	vector<pair<double, pair<int, int>>> p(N);

	for (int i = 0; i < N; ++i){
		cin >> p[i].second.first >> p[i].second.second;
		p[i].first = (double)p[i].second.first / p[i].second.second;
	}

	sort(p.begin(), p.end());

	for (int i = N - 1; i >= 0 ; --i){
		cout << p[i].second.first << " " << p[i].second.second << endl;
	}

	return 0;
}
0