結果
問題 | No.40 多項式の割り算 |
ユーザー | ciel |
提出日時 | 2014-11-16 21:56:13 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 1,205 ms |
コンパイル使用メモリ | 6,988 KB |
実行使用メモリ | 11,356 KB |
最終ジャッジ日時 | 2023-08-30 07:24:21 |
合計ジャッジ時間 | 14,885 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 11 ms
5,952 KB |
testcase_01 | AC | 12 ms
5,860 KB |
testcase_02 | AC | 11 ms
5,984 KB |
testcase_03 | AC | 11 ms
5,864 KB |
testcase_04 | AC | 2,685 ms
6,520 KB |
testcase_05 | AC | 4,394 ms
6,964 KB |
testcase_06 | TLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
ソースコード
#!/usr/bin/python def sub(a,b): m=max(len(a),len(b)) return [(0 if len(a)<=i else a[i])+(0 if len(b)<=i else -b[i]) for i in range(m)] def checkio(exp,div): c=[] while len(div)<=len(exp): d=exp[-1]//div[-1] c.append(d) exp=sub(exp,[0]*(len(exp)-len(div))+[e*d for e in div]) #assert exp[-1]==0 exp.pop() while len(exp)>1 and exp[-1]==0: exp.pop() print(len(exp)-1) print(' '.join(str(e) for e in exp)) import sys if sys.version_info[0]>=3: raw_input=input raw_input() checkio([int(e) for e in raw_input().split()],[0,-1,0,1])