結果

問題 No.745 letinopia raoha
ユーザー tac
提出日時 2019-07-19 16:49:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 1,004 ms
コンパイル使用メモリ 66,048 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 00:07:54
合計ジャッジ時間 1,458 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>

using namespace std;

int mul = 1; //1倍
int sum = 0;
int combo = 0;
void calc(int a, int plus) {
    while (a--) {
        sum += plus * mul;
        combo++;
        if (combo == 100) { combo = 0; mul *= 2; }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (d >= 10) {
        cout << "Impossible" << endl;
        return 0;
    }
    calc(b, 50); calc(a, 100);
    cout << "Possible" << endl;
    cout << sum << endl;
}
0