結果
| 問題 |
No.47 ポケットを叩くとビスケットが2倍
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-15 23:21:05 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 884 bytes |
| コンパイル時間 | 9,432 ms |
| コンパイル使用メモリ | 168,548 KB |
| 実行使用メモリ | 183,908 KB |
| 最終ジャッジ日時 | 2024-06-26 22:09:16 |
| 合計ジャッジ時間 | 11,664 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 20 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (94 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) /home/judge/data/code/Main.cs(14,17): warning CS0219: 変数 'i' は割り当てられていますが、その値は使用されていません [/home/judge/data/code/main.csproj] main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.Intrinsics.X86;
using System.Diagnostics;
namespace yukicoder
{
class Program
{
static void Main()
{
var inp = int.Parse(Console.ReadLine());
var i = 0;
var cnt = 0;
while (inp > 1)
{
inp = inp /= 2;
Console.WriteLine(inp);
cnt++;
}
if (IsEven(cnt))
{
//cnt = cnt + 2;
Console.WriteLine(cnt);
}
else
{
cnt = cnt + 1;
Console.WriteLine(cnt);
Console.WriteLine("-");
}
}
public static bool IsEven(int num)
{
return num % 2 == 0;
}
}
}