結果
| 問題 |
No.2776 Bigger image
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 22:01:51 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,033 bytes |
| コンパイル時間 | 5,498 ms |
| コンパイル使用メモリ | 328,340 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-26 08:03:38 |
| 合計ジャッジ時間 | 6,352 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 WA * 11 |
ソースコード
#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 () {
int A, B; cin >> A >> B;
int 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";
}
}