結果

問題 No.745 letinopia raoha
ユーザー Y17
提出日時 2018-10-22 00:25:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 1,319 ms
コンパイル使用メモリ 158,344 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-19 03:35:04
合計ジャッジ時間 1,849 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if(d >= 10){
    cout << "Impossible" << endl;
    return 0;
  }


  int combo = 0;
  int kasan = 1;
  int ans = 0;
  for(int i = 0;i < b;i++){
    ans += 50 * kasan;
    combo++;
    if(combo % 100 == 0) kasan *= 2;
  }

  for(int i = 0;i < a;i++){
    ans += 100 * kasan;
    combo++;
    if(combo % 100 == 0) kasan *= 2;
  }

  cout << "Possible" << endl;
  cout << ans << endl;

  return 0;
}
0