結果

問題 No.745 letinopia raoha
ユーザー ohreitetsuohreitetsu
提出日時 2018-10-19 22:17:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 559 bytes
コンパイル時間 972 ms
コンパイル使用メモリ 64,460 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-12 01:18:19
合計ジャッジ時間 1,545 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,384 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,384 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
	int A,B,C,D;
	int aV=100;
	int bV=50;
	int dV=-100;
	cin>>A>>B>>C>>D;
	if (D*100>=1000){
		cout<<"Impossible"<<endl;
		return 0;
	}
	int Sum=0;
	if (A<100){
		Sum+=A*aV;
	}else{	
		Sum+=100*aV;
		A-=100;
		int num=2*aV;
		while (A>=100){
			Sum+=100*num;
			A-=100;
			num*=2;
		}
		Sum+=A*num;
	}
	if (B<100){
		Sum+=B*bV;
	}else{	
		Sum+=100*bV;
		B-=100;
		int num=2*bV;
		while (B>=100){
			Sum+=100*num;
			B-=100;
			num*=2;
		}
		Sum+=B*num;
	}
	cout<<Sum<<endl;
	return 0;
}
0