結果

問題 No.750 Frac #1
ユーザー はまやんはまやんはまやんはまやん
提出日時 2018-11-09 21:23:25
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,697 bytes
コンパイル時間 3,021 ms
使用メモリ 3,660 KB
最終ジャッジ日時 2022-12-26 19:26:14
合計ジャッジ時間 2,974 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,564 KB
testcase_01 AC 1 ms
3,516 KB
testcase_02 AC 1 ms
3,540 KB
testcase_03 AC 1 ms
3,588 KB
testcase_04 AC 1 ms
3,520 KB
testcase_05 AC 1 ms
3,612 KB
testcase_06 AC 2 ms
3,528 KB
testcase_07 AC 2 ms
3,576 KB
testcase_08 AC 1 ms
3,552 KB
testcase_09 AC 1 ms
3,636 KB
testcase_10 AC 2 ms
3,480 KB
testcase_11 AC 2 ms
3,556 KB
testcase_12 AC 2 ms
3,632 KB
testcase_13 AC 2 ms
3,580 KB
testcase_14 AC 2 ms
3,516 KB
testcase_15 AC 1 ms
3,516 KB
testcase_16 AC 2 ms
3,524 KB
testcase_17 AC 2 ms
3,520 KB
testcase_18 AC 1 ms
3,560 KB
testcase_19 AC 1 ms
3,524 KB
testcase_20 AC 2 ms
3,516 KB
testcase_21 AC 2 ms
3,520 KB
testcase_22 AC 2 ms
3,516 KB
testcase_23 AC 1 ms
3,552 KB
testcase_24 AC 2 ms
3,532 KB
testcase_25 AC 2 ms
3,544 KB
testcase_26 AC 1 ms
3,524 KB
testcase_27 AC 1 ms
3,576 KB
testcase_28 AC 1 ms
3,532 KB
testcase_29 AC 1 ms
3,580 KB
testcase_30 AC 1 ms
3,576 KB
testcase_31 AC 1 ms
3,584 KB
testcase_32 AC 2 ms
3,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/





int N;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;

    vector<pair<int, int>> v;
    rep(i, 0, N) {
        int a, b; cin >> a >> b;
        v.push_back({a, b});
    }
    sort(all(v), [&](pair<int, int> l, pair<int, int> r) {
        int a = l.first * r.second;
        int b = r.first * l.second;
        return a > b;
    });

    fore(p, v) printf("%d %d\n", p.first, p.second);
}
0