結果

問題 No.2194 兄弟の掛け引き
ユーザー 👑 kakel-sankakel-san
提出日時 2023-09-02 22:35:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 1,000 ms
コード長 818 bytes
コンパイル時間 1,824 ms
コンパイル使用メモリ 65,996 KB
実行使用メモリ 23,888 KB
最終ジャッジ日時 2023-09-02 22:35:12
合計ジャッジ時間 4,550 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,856 KB
testcase_01 AC 61 ms
21,804 KB
testcase_02 AC 61 ms
21,908 KB
testcase_03 AC 61 ms
21,836 KB
testcase_04 AC 60 ms
19,812 KB
testcase_05 AC 60 ms
19,784 KB
testcase_06 AC 61 ms
21,844 KB
testcase_07 AC 61 ms
21,704 KB
testcase_08 AC 60 ms
21,728 KB
testcase_09 AC 61 ms
23,784 KB
testcase_10 AC 60 ms
21,672 KB
testcase_11 AC 61 ms
23,888 KB
testcase_12 AC 60 ms
21,784 KB
testcase_13 AC 61 ms
21,916 KB
testcase_14 AC 62 ms
23,836 KB
testcase_15 AC 61 ms
23,752 KB
testcase_16 AC 61 ms
23,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var p = NList;
        var ans = 0;
        if (p[2] % p[0] == 0 && p[2] <= p[1])
        {
            WriteLine(p[2] / p[0]);
            ++ans;
        }
        if ((p[1] + p[2]) % p[0] == 0)
        {
            WriteLine((p[1] + p[2]) / p[0]);
            ++ans;
        }
        if (ans == 0)
        {
            WriteLine(-1);
        }
    }
}
0