結果

問題 No.598 オーバーフローファンタジー
ユーザー greentea011greentea011
提出日時 2019-03-14 16:54:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 243 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-26 21:09:13
合計ジャッジ時間 1,177 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 9 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main() {
    unsigned int n,x,a,b;
    scanf("%u\n%u\n%u\n%u",&n,&x,&a,&b);
    int atk= (x/a) + ((x%a==0) ? 0 : 1);
    int heal=((1<<(n-1)-x)/b) + (((1<<(n-1)-x)%b==0)?0:1);

    printf("%d\n",(atk>heal)?atk:heal);
}
0