結果

問題 No.2776 Bigger image
ユーザー InTheBloomInTheBloom
提出日時 2024-06-07 22:05:55
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,031 bytes
コンパイル時間 4,303 ms
コンパイル使用メモリ 326,932 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-07 22:06:02
合計ジャッジ時間 5,252 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 2 ms
6,944 KB
testcase_26 AC 2 ms
6,944 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

constexpr int iINF = 1'000'000'000;
constexpr ll llINF = 1'000'000'000'000'000'000;

using rat = pair<ll, ll>;

// 禁じ手を使うぜ!
#include <boost/multiprecision/cpp_int.hpp>
using BigInt = boost::multiprecision::cpp_int;

bool cmp (rat x, rat y) {
    BigInt lhs = x.first;
    lhs *= y.second;
    BigInt rhs = x.second;
    rhs *= y.first;

    return lhs < rhs;
}

int main () {
    ll A, B; cin >> A >> B;
    ll H, W; cin >> H >> W;

    rat non_rotate = make_pair(H * H * B, A);
    if (cmp(make_pair(W * W * A, B), non_rotate)) non_rotate = make_pair(W * W * A, B);

    swap(A, B);
    rat rotate = make_pair(H * H * B, A);
    if (cmp(make_pair(W * W * A, B), rotate)) rotate = make_pair(W * W * A, B);

    if (!cmp(non_rotate, rotate) && !cmp(rotate, non_rotate)) {
        cout << "Same\n";
    }
    else if (cmp(non_rotate, rotate)) {
        cout << "Rotating\n";
    }
    else {
        cout << "Non-rotating\n";
    }
}
0