結果

問題 No.2776 Bigger image
ユーザー ArleenArleen
提出日時 2024-06-07 22:02:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 1,332 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2024-06-07 22:02:25
合計ジャッジ時間 2,303 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,248 KB
testcase_01 AC 41 ms
53,888 KB
testcase_02 AC 39 ms
54,016 KB
testcase_03 AC 39 ms
53,376 KB
testcase_04 AC 38 ms
53,248 KB
testcase_05 AC 38 ms
53,504 KB
testcase_06 AC 38 ms
53,504 KB
testcase_07 AC 40 ms
53,632 KB
testcase_08 AC 39 ms
53,504 KB
testcase_09 AC 40 ms
53,760 KB
testcase_10 AC 40 ms
53,760 KB
testcase_11 AC 40 ms
53,248 KB
testcase_12 AC 40 ms
53,248 KB
testcase_13 AC 39 ms
53,632 KB
testcase_14 AC 39 ms
53,120 KB
testcase_15 AC 40 ms
53,888 KB
testcase_16 AC 43 ms
53,376 KB
testcase_17 AC 40 ms
53,248 KB
testcase_18 AC 40 ms
53,632 KB
testcase_19 AC 40 ms
54,016 KB
testcase_20 AC 40 ms
54,016 KB
testcase_21 AC 39 ms
54,016 KB
testcase_22 AC 40 ms
53,504 KB
testcase_23 AC 40 ms
53,888 KB
testcase_24 AC 40 ms
53,120 KB
testcase_25 AC 39 ms
53,376 KB
testcase_26 AC 39 ms
53,504 KB
testcase_27 AC 40 ms
53,120 KB
testcase_28 AC 42 ms
54,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 縦の長さA, 横の長さBの長方形である画像を縦H, 横Wの画面に表示したい
# 画像を画面に表示する方法は以下の2通り
#  * 画像の向きを変更せず、画像の横の長さがWと一致するように適切に拡大/縮小したものか
#    縦の長さがHと一致するように適切に拡大/縮小したもののうち、小さい方の画像を表示する
#  * 画像を右回りに90度回転し、回転後の画像の横の長さがWと一致するように適切に拡大/縮小したものか
#    回転後の画像の縦の長さがHと一致するように適切に拡大/縮小したもののうち、
#    小さい方の画像を表示する
# より大きく画像を表示できる画像の表示方法を求めよ
#
# 1 <= A, B, H, W <= 10000
# 入力はすべて整数

import sys
import itertools
import time
from math import radians, sin, cos, tan, sqrt
from collections import deque

def input():
    return sys.stdin.readline().replace('\n','')
sys.setrecursionlimit(1000000)
md1 = 998244353
md2 = 10 ** 9 + 7

A, B = map(int, input().split())
H, W = map(int, input().split())

nonrot = min((A*W)**2, (B*H)**2)
rotate = min((B*W)**2, (A*H)**2)

if rotate < nonrot:
    print('Non-rotating')
elif nonrot < rotate:
    print('Rotating')
else:
    print('Same')

0