結果

問題 No.2132 1 or X Game
ユーザー 👑 kakel-sankakel-san
提出日時 2023-09-25 23:47:26
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 821 bytes
コンパイル時間 1,877 ms
コンパイル使用メモリ 65,576 KB
実行使用メモリ 39,044 KB
最終ジャッジ日時 2023-09-25 23:47:35
合計ジャッジ時間 9,435 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,704 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

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();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = NN;
        var ans = new long[t];
        for (var u = 0; u < t; ++u)
        {
            var c = NList;
            var (n, x) = (c[0], c[1]);
            if (x % 2 == 0)
            {
                ans[u] = (n < x) ? (n + 1) / 2 : (n - x) / 2 + x / 2 + 1;
            }
            else
            {
                ans[u] = (n + 1) / 2;
            }
        }
        WriteLine(string.Join("\n", ans.Select(ai => ai % 998_244_353)));
    }
}
0