結果

問題 No.1664 Unstable f(n)
ユーザー lanegue
提出日時 2021-09-05 00:14:12
言語 D
(dmd 2.109.1)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 2,634 ms
コンパイル使用メモリ 206,740 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-22 12:19:43
合計ジャッジ時間 3,629 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.d(4): Deprecation: function `std.math.exponential.log2` is deprecated - `std.math.exponential.log2` called with argument types `(long)` matches both `log2(real)`, `log2(double)`, and `log2(float)`. Cast argument to floating point type instead.

ソースコード

diff #

import std;
void main(){
	auto n=readln.chomp.to!(long);
	long j=cast(long)log2(n);
	long m=n;
	for(;j>0;j--){
		long i=cast(long)(n^^(1.0/j));
		long k=n-(i^^j);
		stderr.writefln("%d %d %d",i,j,k);
		m=min(i+j+k,m);
	}
	writeln(m);
}

0