結果

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

ソースコード

diff #

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

int main(){
  int n;
  cin >> n;
  pair<double, pair<int, int> > p[20];
  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, p+n, greater<pair<double, pair<int, int> > >());

  for(int i = 0;i < n;i++){
    cout << p[i].second.first << " " << p[i].second.second << endl;
  }

  return 0;
}
0