結果
問題 | No.3022 縛りFizzBuzz (Easy) |
ユーザー | KumaTachiRen |
提出日時 | 2022-10-18 15:30:48 |
言語 | C# (.NET 8.0.203) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 520 bytes |
コンパイル時間 | 11,781 ms |
コンパイル使用メモリ | 143,648 KB |
実行使用メモリ | 161,128 KB |
最終ジャッジ日時 | 2023-09-11 08:50:18 |
合計ジャッジ時間 | 13,194 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 49 ms
27,996 KB |
testcase_01 | AC | 48 ms
28,040 KB |
testcase_02 | AC | 48 ms
28,408 KB |
testcase_03 | AC | 49 ms
161,128 KB |
コンパイルメッセージ
Determining projects to restore... Restored /home/judge/data/code/main.csproj (in 133 ms). .NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f Copyright (C) Microsoft Corporation.All rights reserved. プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください main -> /home/judge/data/code/bin/Release/net6.0/main.dll main -> /home/judge/data/code/bin/Release/net6.0/publish/
ソースコード
using System; using System.Collections.Generic; static class Program { static public void Main(string[] args) { int n = int.Parse(Console.ReadLine()); var ans = new List<string>(); for (int i = 'b' - 'a'; i <= n; i++) { var a = ""; if (i % ('d' - 'a') == 'a' - 'a') a += "Fizz"; if (i % ('f' - 'a') == 'a' - 'a') a += "Buzz"; if (a == "") a += i; ans.Add(a); } Console.WriteLine(string.Join("\n", ans)); } }