結果
| 問題 |
No.2393 Bit Grid Connected Component
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-28 21:49:23 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 185 ms / 2,000 ms |
| コード長 | 698 bytes |
| コンパイル時間 | 2,594 ms |
| コンパイル使用メモリ | 111,064 KB |
| 実行使用メモリ | 37,260 KB |
| 最終ジャッジ日時 | 2024-10-06 18:23:25 |
| 合計ジャッジ時間 | 4,826 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 20 |
コンパイルメッセージ
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 (x, y) = (c[0], (int)c[1]);
var max = y;
while ((x & (1L << max + 1)) != 0) ++max;
ans[u] = (1L << max + 1) - 1;
}
WriteLine(string.Join("\n", ans));
}
}