結果

問題 No.604 誕生日のお小遣い
ユーザー NoNo
提出日時 2018-01-25 03:25:57
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 895 bytes
コンパイル時間 4,996 ms
コンパイル使用メモリ 101,320 KB
実行使用メモリ 23,448 KB
最終ジャッジ日時 2023-08-27 05:12:07
合計ジャッジ時間 6,888 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 59 ms
21,180 KB
testcase_02 AC 58 ms
23,248 KB
testcase_03 AC 57 ms
21,208 KB
testcase_04 AC 58 ms
21,396 KB
testcase_05 AC 57 ms
21,276 KB
testcase_06 AC 58 ms
21,240 KB
testcase_07 AC 59 ms
21,244 KB
testcase_08 AC 59 ms
23,224 KB
testcase_09 AC 57 ms
19,240 KB
testcase_10 AC 59 ms
23,276 KB
testcase_11 AC 58 ms
21,272 KB
testcase_12 AC 59 ms
21,256 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 59 ms
21,240 KB
testcase_16 AC 59 ms
21,276 KB
testcase_17 AC 58 ms
23,304 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.

ソースコード

diff #

using System;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            var ss = Console.ReadLine().Split();
            long a = long.Parse(ss[0]);
            long b = long.Parse(ss[1]);
            long c = long.Parse(ss[2]);
            long ans = 999999999999999999;


            for (int i = 17; i >= 0; i--)
            {
                long n = ans;
                for (int j = 0; j < 10; j++)
                {
                    if (j >= 1) n -= (long)Math.Pow(10, i);
                    if (n / a * b + (n - n / a) >= c)
                    {
                        ans = n;
                    }
                }
            }

            if (ans == 999999999999999999 && ans / a * b + (ans - ans / a) < c)
            {
                ans = 1000000000000000000;
            }

            Console.WriteLine(ans);
        }
    }
}
0