結果

問題 No.294 SuperFizzBuzz
ユーザー zizi4n5zizi4n5
提出日時 2017-07-02 14:35:22
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 704 bytes
コンパイル時間 929 ms
コンパイル使用メモリ 110,564 KB
実行使用メモリ 52,504 KB
最終ジャッジ日時 2024-04-15 11:59:38
合計ジャッジ時間 7,510 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
52,504 KB
testcase_01 AC 27 ms
24,752 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder_no294
{
	class MainClass
	{
		public static void Main(string[] args)
		{
			int N = int.Parse(Console.ReadLine());

			//制約の中で最も大きなSuperFizzBuzz(25桁)
			//5533533555333355355553555
			//1111111111111111111111111(33,554,432通り)
            // 1桁目は必ず5

			var count = 0;
			for (var digit = 1; true; digit++)
			{
				for (var i = 1; i < (int)Math.Pow(2, digit); i += 2)
				{
					var b = Convert.ToString(i, 2).PadLeft(digit, '0');
					var num = Decimal.Parse(b.Replace("0", "3").Replace("1", "5"));

					if (num % 15 == 0 && ++count == N)
					{
						Console.WriteLine("{0}", num);
						return;
					}
				}
			}
		}
	}
}
0