結果
問題 | No.2056 非力なレッド |
ユーザー |
|
提出日時 | 2022-08-26 21:27:44 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 120 ms / 2,000 ms |
コード長 | 1,056 bytes |
コンパイル時間 | 1,036 ms |
コンパイル使用メモリ | 109,884 KB |
実行使用メモリ | 38,912 KB |
最終ジャッジ日時 | 2024-10-13 21:52:21 |
合計ジャッジ時間 | 5,550 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
コンパイルメッセージ
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 int[] NList => ReadLine().Split().Select(int.Parse).ToArray();static void Main(){var c = NList;var (n, x, m) = (c[0], c[1], c[2]);var a = NList;while (true){var pos = -1;for (var i = n - 1; i >= 0; --i){if (a[i] >= x){pos = i;break;}}if (pos >= 0){if (pos + 1 > m){WriteLine("No");return;}for (var i = 0; i <= pos; ++i){a[i] /= 2;}m -= pos + 1;}else{WriteLine("Yes");return;}}}}