結果
| 問題 |
No.294 SuperFizzBuzz
|
| コンテスト | |
| ユーザー |
zizi4n5
|
| 提出日時 | 2017-07-02 20:58:24 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 750 bytes |
| コンパイル時間 | 839 ms |
| コンパイル使用メモリ | 112,576 KB |
| 実行使用メモリ | 34,548 KB |
| 最終ジャッジ日時 | 2024-10-05 08:45:24 |
| 合計ジャッジ時間 | 7,382 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | -- * 12 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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 = 3; true; digit++)
{
var max = (int)Math.Pow(2, digit);
for (var i = 1; i < max; i += 2)
{
var b = Convert.ToString(i, 2);
var num = Decimal.Parse(b.Replace("0", "3").Replace("1", "5").PadLeft(digit, '3'));
if (num % 15 == 0 && ++count == N)
{
Console.WriteLine("{0}", num);
return;
}
}
}
}
}
}
zizi4n5