結果
| 問題 |
No.4 おもりと天秤
|
| コンテスト | |
| ユーザー |
6soukiti29
|
| 提出日時 | 2017-07-05 19:33:38 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 384 bytes |
| コンパイル時間 | 3,237 ms |
| コンパイル使用メモリ | 66,608 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 01:34:00 |
| 合計ジャッジ時間 | 4,087 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 10 |
ソースコード
import sequtils,strutils,math
var
N = stdin.readline.parseInt
W : seq[int]
W = stdin.readline.split.map(parseInt)
var A = newSeqWith(sum(W) div 2 + 2,false)
A[0] = true
for w in W:
for i in countdown(sum(W) div 2 + 1,w):
if A[i - w] == true:
A[i] = true
if sum(W) mod 2 == 0 and A[sum(W) div 2] == true:
echo "possible"
else:
echo "imposible"
6soukiti29