結果

問題 No.2776 Bigger image
ユーザー tobbie
提出日時 2024-06-08 16:51:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 1,608 ms
コンパイル使用メモリ 165,400 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-28 04:50:14
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define rep(i, n) for (int i=0; i<(int)n; i++)
using ll = long long int;

int main() {
  int A, B;
  cin >> A >> B;
  int H, W;
  cin >> H >> W;
  auto f = [&](int a, int b) {
    if (a * W > b * H) {
      return (ll)H*b * H * b;
    } else {
      return (ll)W*a * W * a;
    }
    return (ll)0;
  };
  ll s0 = f(A, B);
  ll s1 = f(B, A);
  if (s0 > s1)
    cout << "Non-rotating" << endl;
  else if (s0 < s1)
    cout << "Rotating" << endl;
  else
    cout << "Same" << endl;
  return 0;
}
0