結果

問題 No.745 letinopia raoha
ユーザー SSRS
提出日時 2020-08-26 18:39:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 763 ms
コンパイル使用メモリ 72,292 KB
最終ジャッジ日時 2025-01-13 15:02:07
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	if (D == 10){
		cout << "Impossible" << endl;
	} else {
		vector<int> s;
		for (int i = 0; i < B; i++){
			s.push_back(50);
		}
		for (int i = 0; i < A; i++){
			s.push_back(100);
		}
		int m = 1;
		int ans = 0;
		for (int i = 0; i < A + B; i++){
			ans += s[i] * m;
			if (i % 100 == 99){
				m *= 2;
			}
		}
		cout << "Possible" << endl;
		cout << ans<< endl;
	}
}
0