結果

問題 No.1176 少ない質問
ユーザー masayoshi361masayoshi361
提出日時 2020-08-21 21:46:35
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 752 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 110,304 KB
実行使用メモリ 27,388 KB
最終ジャッジ日時 2024-04-23 05:45:32
合計ジャッジ時間 2,211 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
27,136 KB
testcase_01 AC 29 ms
27,264 KB
testcase_02 AC 29 ms
27,028 KB
testcase_03 AC 30 ms
25,252 KB
testcase_04 AC 29 ms
25,248 KB
testcase_05 AC 29 ms
27,132 KB
testcase_06 AC 29 ms
27,156 KB
testcase_07 AC 28 ms
25,004 KB
testcase_08 AC 29 ms
25,120 KB
testcase_09 AC 29 ms
25,084 KB
testcase_10 AC 28 ms
25,124 KB
testcase_11 AC 29 ms
27,160 KB
testcase_12 AC 28 ms
22,832 KB
testcase_13 AC 28 ms
24,732 KB
testcase_14 AC 28 ms
25,120 KB
testcase_15 AC 29 ms
24,992 KB
testcase_16 AC 29 ms
27,136 KB
testcase_17 AC 29 ms
27,160 KB
testcase_18 AC 29 ms
25,140 KB
testcase_19 AC 29 ms
25,124 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;class Program
{
	
	static void Main(string[] args)
	{
        //var exStdIn = new System.IO.StreamReader( "stdin.txt" );System.Console.SetIn( exStdIn );
		//const long inf = 100000000000000;
		long a = Console.ReadLine().Split().Select(long.Parse).ToArray()[0];
		long tmp = 1;
		long ans;
		long cnt = 0;
		while(a>tmp){
			tmp*=2;
			cnt++;
		}
		ans = cnt*2;
		tmp = 1;
		cnt = 0;
		while(tmp<a){
			tmp*=3;
			cnt++;
		}
		ans = Min(ans, cnt*3);
		Console.WriteLine(ans);
	}
}
0