結果

問題 No.1860 Magnets
ユーザー 👑 kakel-sankakel-san
提出日時 2022-03-04 22:29:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 631 bytes
コンパイル時間 1,312 ms
コンパイル使用メモリ 63,828 KB
実行使用メモリ 26,100 KB
最終ジャッジ日時 2023-09-26 01:35:58
合計ジャッジ時間 4,629 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
21,972 KB
testcase_01 AC 63 ms
21,972 KB
testcase_02 AC 62 ms
21,816 KB
testcase_03 AC 62 ms
23,984 KB
testcase_04 AC 63 ms
21,912 KB
testcase_05 AC 62 ms
21,976 KB
testcase_06 AC 62 ms
21,924 KB
testcase_07 AC 63 ms
21,920 KB
testcase_08 AC 63 ms
21,820 KB
testcase_09 AC 62 ms
22,024 KB
testcase_10 AC 62 ms
21,996 KB
testcase_11 AC 62 ms
21,872 KB
testcase_12 AC 63 ms
23,964 KB
testcase_13 AC 63 ms
21,888 KB
testcase_14 AC 63 ms
22,012 KB
testcase_15 AC 62 ms
22,108 KB
testcase_16 AC 63 ms
21,960 KB
testcase_17 AC 62 ms
21,784 KB
testcase_18 AC 63 ms
26,100 KB
testcase_19 AC 62 ms
21,928 KB
testcase_20 AC 62 ms
21,936 KB
testcase_21 AC 63 ms
24,004 KB
testcase_22 AC 62 ms
21,936 KB
testcase_23 AC 61 ms
21,808 KB
testcase_24 AC 62 ms
19,884 KB
testcase_25 AC 62 ms
22,040 KB
testcase_26 AC 62 ms
21,976 KB
testcase_27 AC 61 ms
22,004 KB
testcase_28 AC 62 ms
21,820 KB
testcase_29 AC 62 ms
21,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    static long[][] NArr(int n) => Enumerable.Repeat(0, n).Select(_ => NList).ToArray();
    static void Main()
    {
        var c = NList;
        var (a, b) = (c[0], c[1]);
        if (Math.Abs(a - b) > 1)
        {
            var d = Math.Abs(a - b) - 1;
            WriteLine(a + b + d);
        }
        else
        {
            WriteLine(a + b);
        }
    }
}
0