結果
問題 | No.598 オーバーフローファンタジー |
ユーザー | mban |
提出日時 | 2017-12-01 18:33:16 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,788 bytes |
コンパイル時間 | 4,965 ms |
コンパイル使用メモリ | 105,864 KB |
実行使用メモリ | 22,892 KB |
最終ジャッジ日時 | 2023-08-18 15:26:16 |
合計ジャッジ時間 | 5,995 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 49 ms
22,800 KB |
testcase_01 | AC | 49 ms
20,792 KB |
testcase_02 | AC | 49 ms
20,792 KB |
testcase_03 | AC | 49 ms
20,608 KB |
testcase_04 | AC | 50 ms
22,712 KB |
testcase_05 | AC | 48 ms
20,792 KB |
testcase_06 | AC | 47 ms
20,672 KB |
testcase_07 | AC | 48 ms
22,816 KB |
testcase_08 | AC | 47 ms
20,656 KB |
testcase_09 | AC | 50 ms
20,764 KB |
testcase_10 | AC | 49 ms
20,800 KB |
testcase_11 | AC | 50 ms
20,824 KB |
testcase_12 | AC | 50 ms
22,748 KB |
testcase_13 | AC | 47 ms
20,616 KB |
testcase_14 | AC | 47 ms
22,692 KB |
testcase_15 | AC | 47 ms
18,812 KB |
testcase_16 | AC | 47 ms
20,768 KB |
testcase_17 | AC | 48 ms
20,668 KB |
testcase_18 | AC | 48 ms
20,824 KB |
testcase_19 | AC | 48 ms
22,788 KB |
testcase_20 | AC | 47 ms
20,764 KB |
testcase_21 | AC | 46 ms
20,752 KB |
testcase_22 | AC | 47 ms
20,824 KB |
testcase_23 | AC | 48 ms
20,796 KB |
testcase_24 | WA | - |
testcase_25 | AC | 49 ms
22,632 KB |
testcase_26 | AC | 49 ms
22,764 KB |
testcase_27 | AC | 47 ms
20,688 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Scanner { private readonly char Separator = ' '; private int Index = 0; private string[] Line = new string[0]; public string Next() { if (Index >= Line.Length) { Line = Console.ReadLine().Split(Separator); Index = 0; } var ret = Line[Index]; Index++; return ret; } public int NextInt() { return int.Parse(Next()); } public long NextLong() { return long.Parse(Next()); } public string[] StringArray() { Line = Console.ReadLine().Split(Separator); Index = Line.Length; return Line; } public int[] IntArray() { var l = StringArray(); var res = new int[l.Length]; for (int i = 0; i < l.Length; i++) { res[i] = int.Parse(l[i]); } return res; } public long[] LongArray() { var l = StringArray(); var res = new long[l.Length]; for (int i = 0; i < l.Length; i++) { res[i] = long.Parse(l[i]); } return res; } } class Program { private int N, X, A, B; private void Scan() { var sc = new Scanner(); N = sc.NextInt(); X = sc.NextInt(); A = sc.NextInt(); B = sc.NextInt(); } public void Solve() { Scan(); long OverFlow = 1 << (N - 1); int cntAttack = (X + A - 1) / A; int cntHeal = (int)(OverFlow - X + B - 1) / B; Console.WriteLine(Math.Min(cntAttack, cntHeal)); } static void Main(string[] args) { new Program().Solve(); } }