結果
問題 | No.604 誕生日のお小遣い |
ユーザー | mban |
提出日時 | 2017-12-15 16:45:58 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,641 bytes |
コンパイル時間 | 902 ms |
コンパイル使用メモリ | 113,088 KB |
実行使用メモリ | 26,256 KB |
最終ジャッジ日時 | 2024-05-08 12:13:39 |
合計ジャッジ時間 | 2,293 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 24 ms
26,132 KB |
testcase_02 | AC | 24 ms
25,888 KB |
testcase_03 | AC | 24 ms
22,068 KB |
testcase_04 | AC | 24 ms
23,828 KB |
testcase_05 | AC | 24 ms
23,772 KB |
testcase_06 | AC | 25 ms
26,200 KB |
testcase_07 | AC | 24 ms
26,128 KB |
testcase_08 | AC | 24 ms
24,092 KB |
testcase_09 | AC | 23 ms
21,940 KB |
testcase_10 | AC | 24 ms
23,908 KB |
testcase_11 | AC | 23 ms
26,136 KB |
testcase_12 | AC | 25 ms
24,116 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 24 ms
23,984 KB |
testcase_16 | AC | 23 ms
23,968 KB |
testcase_17 | AC | 25 ms
24,028 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | 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; } } struct S { public int Begin, End, Length; public S(int b, int e) { Begin = b; End = e; Length = e - b + 1; } } class SegmentTree<T> { private T[] Array; private readonly int N; private Comparison<T> Comparison; private readonly T Min; public SegmentTree(int length, T min) : this(length, min, Comparer<T>.Default) { } public SegmentTree(int length, T min, IComparer<T> comparer) : this(length, min, comparer.Compare) { } public SegmentTree(int length, T min, Comparison<T> comparison) { for (N = 1; N < length; N *= 2) ; Array = new T[N * 2]; Min = min; for (int i = 1; i < N * 2; i++) { Array[i] = Min; } Comparison = comparison; } private T Max(T a, T b) { if (Comparison(a, b) >= 0) { return a; } else { return b; } } public void Update(int index, T value) { index += N; Array[index] = value; for (index = index / 2; index > 0; index /= 2) { Array[index] = Max(Array[index * 2], Array[index * 2 + 1]); } } private T Query(int a, int b, int k, int l, int r) { if (a <= l && r <= b) { return Array[k]; } if (b <= l || r <= a) { return Min; } T left = Query(a, b, k * 2, l, (l + r) / 2); T right = Query(a, b, k * 2 + 1, (l + r) / 2, r); return Max(left, right); } public T Query(int a, int b) { return Query(a, b, 1, 0, N); } } class Program { private long A, B, C; private void Scan() { var sc = new Scanner(); A = sc.NextLong(); B = sc.NextLong(); C = sc.NextLong(); } public void Solve() { Scan(); long min = 0; long max = (long)1e18 + 1; while (max - min > 1) { long mid = (min + max) / 2; if (F(mid) >= C) { max = mid; } else { min = mid; } } Console.WriteLine(max); } public long F(long y) { return y + ((y / A) * (B - 1)); } static void Main(string[] args) { new Program().Solve(); } }