結果
問題 |
No.593 4進FizzBuzz
|
ユーザー |
![]() |
提出日時 | 2018-01-21 00:31:01 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 605 bytes |
コンパイル時間 | 2,493 ms |
コンパイル使用メモリ | 107,892 KB |
実行使用メモリ | 39,244 KB |
最終ジャッジ日時 | 2024-12-25 04:13:49 |
合計ジャッジ時間 | 12,891 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 WA * 12 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace y { class Program { static void Main(string[] args) { string n4 = Console.ReadLine(); long a = 0; long n10 = 0; for (int i = n4.Length - 1; i >= 0; i--) { n10 += (long)((long.Parse(Convert.ToString(n4[i]))) * Math.Pow(4, a)); a++; } string ans = ""; if (n10 % 3 == 0) ans += "Fizz"; if (n10 % 5 == 0) ans += "Buzz"; if (ans.Length == 0) ans = n4; Console.WriteLine(ans); } } }