結果
問題 | No.2132 1 or X Game |
ユーザー |
|
提出日時 | 2023-09-25 23:47:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 821 bytes |
コンパイル時間 | 2,927 ms |
コンパイル使用メモリ | 107,136 KB |
実行使用メモリ | 32,256 KB |
最終ジャッジ日時 | 2024-07-18 19:15:33 |
合計ジャッジ時間 | 9,847 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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)));}}