結果
問題 |
No.897 compαctree
|
ユーザー |
![]() |
提出日時 | 2021-05-27 15:55:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 581 bytes |
コンパイル時間 | 1,772 ms |
コンパイル使用メモリ | 111,472 KB |
実行使用メモリ | 26,076 KB |
最終ジャッジ日時 | 2024-11-06 09:50:44 |
合計ジャッジ時間 | 2,771 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using static System.Math; using System; public class Hello { static void Main() { var q = int.Parse(Console.ReadLine().Trim()); while (q-- > 0) { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); long k = int.Parse(line[1]); if (k == 1) Console.WriteLine(n - 1); else getAns(n, k); } } static void getAns(int n, long k) { long a = n * (k - 1); var p = Log10(a + 1) / Log10(k); Console.WriteLine((int)p); } }