結果
| 問題 |
No.4 おもりと天秤
|
| コンテスト | |
| ユーザー |
Hirake
|
| 提出日時 | 2017-04-05 08:02:59 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 582 bytes |
| コンパイル時間 | 75 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-08 10:12:01 |
| 合計ジャッジ時間 | 1,335 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 1 RE * 20 |
ソースコード
# your code goes here
n = input()
b = list(int(i) for i in input().split())
b.reverse()
N=sum(b)
e=1
#print(N)
def sca(e,r,i,ba):
if e==0:
return 0
elif r-ba[i]==0:
e=0
return 0
elif r-ba[i] < 0:
print(r-ba[i])
return 1*sca(e,r,i+1,ba)
elif len(ba)==1:
return 1
else:
ba=ba.pop(i)
print(ba)
return 1*sca(e,r-b[i],i,ba)
if N/2!=int(N/2):
print("impossible")
else:
N=int(N/2)
print(N)
if sca(e,N,0,b)==0:
print("possible")
else:
print("impossible")
Hirake