結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-10 13:53:40 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 304 bytes |
| 記録 | |
| コンパイル時間 | 1,675 ms |
| コンパイル使用メモリ | 167,856 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2026-01-10 13:53:46 |
| 合計ジャッジ時間 | 5,767 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 23 |
ソースコード
#include <iostream>
#include <vector>
int main(){
int N;std::cin>>N;
std::vector<int> W(N);for(auto& w:W)std::cin>>w;
int sum=0;
for(auto& w:W)sum+=w;
std::vector<bool> X(2*sum+1);
X[0]=1;
for(auto& w:W)for(int i=2*sum;i>=2*w;i++)X[i]=X[i-2*w]|X[i];
std::cout<<(X[sum]?"possible":"impossible");
}