結果
問題 | No.2533 A⇒B問題 |
ユーザー |
|
提出日時 | 2023-11-10 21:48:09 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 600 bytes |
コンパイル時間 | 7,524 ms |
コンパイル使用メモリ | 170,060 KB |
実行使用メモリ | 188,088 KB |
最終ジャッジ日時 | 2024-09-26 01:22:46 |
合計ジャッジ時間 | 9,570 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (92 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System; class Program { static void Main(string[] args) { var input = Console.ReadLine().Split(' '); var a = Convert.ToString(int.Parse(input[0]), 2); var b = Convert.ToString(int.Parse(input[1]), 2); var same = a.Length <= b.Length; if (same) { b = b.Substring(b.Length - a.Length, a.Length); var i = 0; while (same && i < a.Length) { same = a[i] == '0' || a[i] == b[i]; i++; } } Console.WriteLine(same? "Yes" : "No"); } }