結果

問題 No.3003 多項式の割り算 〜hard〜
ユーザー Cecil
提出日時 2025-01-17 23:03:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2025-01-17 23:04:21
合計ジャッジ時間 4,486 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
A,B = map(int, input().split())
if B==0:
    print(0,A)
    exit()
if B==1:
    print(A,0)
    exit()
idx = B%3
if idx==2:
    print(-A,-A)
elif idx==0:
    print(0,A)
else:
    print(A,0)
0