結果
| 問題 | 
                            No.745 letinopia raoha
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Konton7
                         | 
                    
| 提出日時 | 2020-01-14 14:50:28 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 597 bytes | 
| コンパイル時間 | 2,141 ms | 
| コンパイル使用メモリ | 192,224 KB | 
| 最終ジャッジ日時 | 2025-01-08 17:58:57 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 8 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int a, b, c, d, e, ans;
    cin >> a >> b >> c >> d;
    if (d == 10)
        cout << "Impossible" << endl;
    else{
        cout << "Possible" << endl;
        e = a + b;
        ans = 0;
        for(int i = 0; i < 8; i++){
            c = min(100, e);
            ans += pow(2,i)*100*c;
            e -= c;
        }
        for(int i = 0; i < 8; i++){
            c = min(100, b);
            ans -= pow(2,i)*50*c;
            b -= c;
        }
        cout << ans << endl;
    }
    
    
    return 0;
}
            
            
            
        
            
Konton7