結果

問題 No.750 Frac #1
コンテスト
ユーザー Rumain831
提出日時 2026-09-22 00:37:08
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 413µs
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,714 ms
コンパイル使用メモリ 183,888 KB
実行使用メモリ 9,868 KB
最終ジャッジ日時 2026-09-22 00:37:12
合計ジャッジ時間 3,279 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using P = pair<int, int>;

int main(void){
  int n; cin >> n;
  vector<P> ans;
  for(int i=0; i<n; i++){
    int a, b; cin >> a >> b;
    ans.emplace_back(a, b);
  }
  sort(begin(ans), end(ans), [](const P& a, const P& b){
    return a.first*b.second>a.second*b.first;
  });
  for(auto [a, b]:ans) cout << a << ' ' << b << endl;
  return 0; 
}
0