結果
問題 |
No.4 おもりと天秤
|
ユーザー |
|
提出日時 | 2017-09-16 14:31:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 628 bytes |
コンパイル時間 | 1,323 ms |
コンパイル使用メモリ | 158,060 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 01:31:52 |
合計ジャッジ時間 | 2,175 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define REPR(i, n) for(int i = n;i >= 0;i--) #define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++) #define FORVEC(i, v) for(int i = 0;i < v.size();i++) #define INF 1000000000 #define pb(a) push_back(a) #define llong long long int main(){ int n,buf; int sum=0; bool can[10001]={true}; cin>>n; REP(i,n){ cin>>buf; sum+=buf; REPR(j,10000) if(can[j])can[j+buf]=true; } if(sum%2)cout<<"impossible"<<endl; else if(can[sum/2])cout<<"possible"<<endl; else cout<<"impoissible"<<endl; return 0; }