結果

問題 No.2194 兄弟の掛け引き
ユーザー bluemeganebluemegane
提出日時 2023-01-20 22:42:34
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 1,000 ms
コード長 586 bytes
コンパイル時間 1,002 ms
コンパイル使用メモリ 69,524 KB
実行使用メモリ 22,848 KB
最終ジャッジ日時 2023-09-05 15:04:05
合計ジャッジ時間 3,248 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,588 KB
testcase_01 AC 59 ms
22,744 KB
testcase_02 AC 58 ms
22,708 KB
testcase_03 AC 61 ms
20,644 KB
testcase_04 AC 58 ms
20,844 KB
testcase_05 AC 57 ms
20,720 KB
testcase_06 AC 58 ms
20,836 KB
testcase_07 AC 58 ms
20,652 KB
testcase_08 AC 58 ms
20,820 KB
testcase_09 AC 61 ms
22,848 KB
testcase_10 AC 58 ms
20,660 KB
testcase_11 AC 58 ms
20,824 KB
testcase_12 AC 57 ms
18,760 KB
testcase_13 AC 60 ms
20,920 KB
testcase_14 AC 60 ms
20,816 KB
testcase_15 AC 58 ms
22,840 KB
testcase_16 AC 59 ms
18,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = int.Parse(line[0]);
        var b = int.Parse(line[1]);
        var c = int.Parse(line[2]);
        var ans = new List<int>();
        if ((b + c) % a == 0) ans.Add((b + c) / a);
        if (c % a == 0 && c <= b) ans.Add(c / a);
        ans.Sort();
        if (ans.Count == 0) Console.WriteLine(-1);
        else Console.WriteLine(string.Join("\n", ans));
    }
}
0