結果
| 問題 |
No.642 Two Operations No.1
|
| コンテスト | |
| ユーザー |
wagashi1349
|
| 提出日時 | 2018-02-22 16:50:18 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| コード長 | 500 bytes |
| コンパイル時間 | 699 ms |
| コンパイル使用メモリ | 103,040 KB |
| 実行使用メモリ | 17,792 KB |
| 最終ジャッジ日時 | 2024-10-01 21:00:35 |
| 合計ジャッジ時間 | 1,504 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Int64 N = Int64.Parse(Console.ReadLine());
Int64 time = 0;
while(N != 1)
{
time++;
if ((N & 0x01) == 1)
{
N++;
} else
{
N = N >> 1;
}
}
Console.WriteLine(time);
}
}
}
wagashi1349