結果

問題 No.604 誕生日のお小遣い
ユーザー bluemeganebluemegane
提出日時 2021-04-24 09:51:25
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 61,252 KB
実行使用メモリ 24,816 KB
最終ジャッジ日時 2023-09-17 13:31:16
合計ジャッジ時間 3,295 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 58 ms
20,732 KB
testcase_02 AC 58 ms
22,708 KB
testcase_03 AC 58 ms
20,724 KB
testcase_04 AC 58 ms
20,748 KB
testcase_05 AC 58 ms
20,636 KB
testcase_06 AC 58 ms
20,644 KB
testcase_07 AC 58 ms
20,844 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 58 ms
20,848 KB
testcase_11 AC 58 ms
18,724 KB
testcase_12 AC 57 ms
18,528 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 58 ms
22,676 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = long.Parse(line[0]);
        var b = long.Parse(line[1]);
        var c = long.Parse(line[2]);
        getAns(a, b, c);
    }
    static void getAns(long a, long b, long c)
    {
        var s = a + b - 1;
        var t = c / s;
        if (t == 0)
        {
            if (a - 1 <= c) Console.WriteLine(c);
            else Console.WriteLine(a);
            return;
        }
        var t2 = c % s;
        var ans = t * a + t2;
        Console.WriteLine(ans);
    }
}
0