結果
問題 | No.40 多項式の割り算 |
ユーザー | vwxyz |
提出日時 | 2021-06-19 17:02:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 281 ms / 5,000 ms |
コード長 | 935 bytes |
コンパイル時間 | 285 ms |
コンパイル使用メモリ | 87,168 KB |
実行使用メモリ | 95,384 KB |
最終ジャッジ日時 | 2023-09-05 01:01:21 |
合計ジャッジ時間 | 11,462 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 271 ms
91,680 KB |
testcase_01 | AC | 263 ms
91,552 KB |
testcase_02 | AC | 268 ms
91,924 KB |
testcase_03 | AC | 261 ms
91,636 KB |
testcase_04 | AC | 274 ms
94,820 KB |
testcase_05 | AC | 270 ms
95,132 KB |
testcase_06 | AC | 273 ms
94,916 KB |
testcase_07 | AC | 275 ms
95,384 KB |
testcase_08 | AC | 264 ms
91,684 KB |
testcase_09 | AC | 274 ms
94,856 KB |
testcase_10 | AC | 277 ms
94,952 KB |
testcase_11 | AC | 270 ms
94,796 KB |
testcase_12 | AC | 276 ms
94,940 KB |
testcase_13 | AC | 271 ms
95,148 KB |
testcase_14 | AC | 281 ms
94,856 KB |
testcase_15 | AC | 273 ms
94,904 KB |
testcase_16 | AC | 277 ms
95,156 KB |
testcase_17 | AC | 269 ms
92,624 KB |
testcase_18 | AC | 273 ms
94,888 KB |
testcase_19 | AC | 269 ms
95,172 KB |
testcase_20 | AC | 271 ms
94,592 KB |
testcase_21 | AC | 274 ms
92,572 KB |
testcase_22 | AC | 274 ms
92,692 KB |
testcase_23 | AC | 281 ms
94,744 KB |
testcase_24 | AC | 272 ms
95,056 KB |
testcase_25 | AC | 267 ms
91,684 KB |
testcase_26 | AC | 263 ms
91,740 KB |
testcase_27 | AC | 264 ms
91,504 KB |
testcase_28 | AC | 260 ms
91,500 KB |
testcase_29 | AC | 263 ms
91,560 KB |
testcase_30 | AC | 263 ms
91,812 KB |
testcase_31 | AC | 260 ms
91,796 KB |
testcase_32 | AC | 264 ms
91,556 KB |
testcase_33 | AC | 262 ms
91,496 KB |
testcase_34 | AC | 262 ms
91,708 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys from collections import Counter, deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines D=int(readline()) A=list(map(int,readline().split())) ans_lst=[0]*3 ans_lst[0]=A[0] for i in range(1,D+1): if i%2==1: ans_lst[1]+=A[i] else: ans_lst[2]+=A[i] while len(ans_lst)>=2 and ans_lst[-1]==0: ans_lst.pop() print(len(ans_lst)-1) print(*ans_lst)