結果
| 問題 | No.756 チャンパーノウン定数 (1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-10 12:44:26 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 70 ms / 2,000 ms |
| コード長 | 685 bytes |
| 記録 | |
| コンパイル時間 | 7,544 ms |
| コンパイル使用メモリ | 169,624 KB |
| 実行使用メモリ | 188,380 KB |
| 最終ジャッジ日時 | 2025-12-10 12:44:37 |
| 合計ジャッジ時間 | 10,079 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (108 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
class Program
{
static void Main()
{
long n = long.Parse(Console.ReadLine());
long digits = 1;
long count = 9;
long start = 1;
// N がどの桁数の領域に存在するかを探す
while (n > digits * count)
{
n -= digits * count;
digits++;
count *= 10;
start *= 10;
}
// その桁数の中で何番目の数字に属するか
long num = start + (n - 1) / digits;
// 数字の中のどの桁か
int index = (int)((n - 1) % digits);
string s = num.ToString();
Console.WriteLine(s[index]);
}
}