結果
| 問題 | No.598 オーバーフローファンタジー |
| コンテスト | |
| ユーザー |
greentea011
|
| 提出日時 | 2019-03-14 16:57:29 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 40,632 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-13 16:44:03 |
| 合計ジャッジ時間 | 1,555 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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