結果
| 問題 | No.47 ポケットを叩くとビスケットが2倍 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-21 11:32:38 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 5,000 ms |
| コード長 | 638 bytes |
| 記録 | |
| コンパイル時間 | 2,226 ms |
| コンパイル使用メモリ | 109,776 KB |
| 実行使用メモリ | 24,168 KB |
| 最終ジャッジ日時 | 2026-03-28 20:32:06 |
| 合計ジャッジ時間 | 6,479 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
namespace PracticeAtCoder
{
class Program
{
static void Main(string[] args)
{
//047ビスケット
String sA = Console.ReadLine();
int intX = int.Parse(sA);//希望の個数
int iMin = 1;//最小何個?
int iMax = 1;//最大何個?
int iX = 0;//たたいた回数
//2^x のXの数を図る
//intN=15
//9<=15<=16 が同じ回数
while(!(intX <= iMax && iMin <= intX)){
iMin = iMax + 1;
iMax = iMax * 2;
iX++;
}
Console.WriteLine(iX);
}
}
}