結果
| 問題 |
No.750 Frac #1
|
| コンテスト | |
| ユーザー |
Yut176
|
| 提出日時 | 2019-06-06 02:07:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 627 bytes |
| コンパイル時間 | 901 ms |
| コンパイル使用メモリ | 89,336 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 17:45:19 |
| 合計ジャッジ時間 | 2,006 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
long long mod = 1e9 + 7;
bool comp(pair<int, int> l, pair<int,int> r) {
return (l.first * r.second) > (l.second * r.first);
}
int main(void) {
int n; cin >> n;
vector<pair<int,int>> p(n);
for(int i=0; i<n; i++) cin >> p[i].first >> p[i].second;
sort(p.begin(), p.end(), comp);
for(int i=0; i<n; i++) {
cout << p[i].first << " " << p[i].second << endl;
}
return 0;
}
// EOF
Yut176