結果
問題 | No.598 オーバーフローファンタジー |
ユーザー |
![]() |
提出日時 | 2017-11-24 22:46:29 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 413 bytes |
コンパイル時間 | 957 ms |
コンパイル使用メモリ | 99,900 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 22:37:51 |
合計ジャッジ時間 | 2,221 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
import std.stdio;import std.algorithm;import std.string;import std.conv;import std.math;void main() {int n = readln.chomp.to!int;int x = readln.chomp.to!int;int a = readln.chomp.to!int;int b = readln.chomp.to!int;int maxhp = (1 << (n - 1)), aa, bb;aa = (x / a); if (x % a != 0) aa++;bb = ((maxhp - x) / b); if ((maxhp - x) % b != 0) bb++;if (aa < bb) aa.writeln;else bb.writeln;}