結果
| 問題 | No.822 Bitwise AND |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-07 23:06:08 |
| 言語 | C# (.NET 10.0.201) |
| 結果 |
AC
|
| 実行時間 | 72 ms / 2,000 ms |
| コード長 | 757 bytes |
| 記録 | |
| コンパイル時間 | 12,366 ms |
| コンパイル使用メモリ | 174,540 KB |
| 実行使用メモリ | 198,148 KB |
| 最終ジャッジ日時 | 2026-06-07 23:06:32 |
| 合計ジャッジ時間 | 19,632 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (129 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
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();
public static void Main()
{
Solve();
}
static void Solve()
{
var c = NList;
if (c[0] < c[1])
{
WriteLine("INF");
return;
}
var ans = 0;
for (var x = c[0]; x <= c[0] * 2; ++x)
{
if ((x & c[0]) != c[0]) continue;
for (var y = x; y <= x + c[1]; ++y)
{
if ((x & y) == c[0]) ++ans;
}
}
WriteLine(ans);
}
}