結果
| 問題 |
No.3003 多項式の割り算 〜hard〜
|
| コンテスト | |
| ユーザー |
prin_kemkem
|
| 提出日時 | 2025-01-17 21:32:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 2,000 ms |
| コード長 | 854 bytes |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 81,796 KB |
| 実行使用メモリ | 55,808 KB |
| 最終ジャッジ日時 | 2025-01-17 21:32:46 |
| 合計ジャッジ時間 | 2,282 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
from collections import defaultdict, deque, Counter
# from functools import cache
# import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
# from more_itertools import distinct_permutations
from heapq import heapify, heappop, heappush, heappushpop
import math
import bisect
# from pprint import pprint
from random import randint, shuffle, randrange
# from sortedcontainers import SortedSet, SortedList, SortedDict
import sys
# sys.setrecursionlimit(2000000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)
#################################################
A, B = map(int, input().split())
B %= 3
dp = [0]*(B+2)
dp[B] = A
for i in range(B-2, -1, -1):
c = dp[i+2]
dp[i+1] -= c
dp[i] -= c
print(dp[1], dp[0])
prin_kemkem