結果

問題 No.4 おもりと天秤
コンテスト
ユーザー albicilla
提出日時 2016-04-05 19:41:19
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 310 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 263 ms
コンパイル使用メモリ 70,248 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-09 22:43:03
合計ジャッジ時間 1,911 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cstdio>

using namespace std;


int n;
int w[110];
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>w[i];
	}
	int ans1=0,ans2=0;

	for(int i=0;i<n;i++){
		ans1+=w[i];
		if(ans1>ans2){
			ans2+=w[i];
		}
	}
	if(ans2==ans1)cout<<"possible"<<endl;
	else cout<<"impossible"<<endl;
}
0