結果

問題 No.745 letinopia raoha
ユーザー masamasa
提出日時 2019-01-31 10:01:39
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 965 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 64,204 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-25 15:37:40
合計ジャッジ時間 1,125 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
using namespace std;
template<class T> bool maxPointer(T& a, T b) { if (a < b) {a = b;return true;}return false;}
template<class T> int maxReturn(T a, T b) {if (a > b) {return a;} else {return b;}}
template<class T> bool minPointer(T& a, T b) {if (a < b) {a = b;return true;}return false;}

const int life = 1000;
const string failedMsg  = "Impossible";
const string successMsg = "Possible";

int comboResult(int a, int b) {
    int bounus = 1;
    int addpoint = 50;
    int ans = 0;
    
    for (int i = 0; i < a + b; i++) {
        if (i == b) addpoint = 100;
        if (i != 0 && i % 100 == 0) bounus += bounus;
    
        ans += addpoint * bounus;
    }
    
    return ans;
}

int main(void){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    
    if (life <= D * 100) {
        cout << failedMsg << endl;
        exit(0);
    }

    cout << successMsg << endl;
    cout << comboResult(A, B) << endl;
}
0