結果
| 問題 |
No.598 オーバーフローファンタジー
|
| コンテスト | |
| ユーザー |
greentea011
|
| 提出日時 | 2019-03-14 16:57:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 288 bytes |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 31,232 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-26 21:12:50 |
| 合計ジャッジ時間 | 1,193 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 28 |
ソースコード
#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("atk=%d,heal=%d\n",atk,heal);
printf("%d\n",(atk>heal)?heal:atk);
}
greentea011