結果
問題 | No.3022 縛りFizzBuzz (Easy) |
ユーザー | nebukuro09 |
提出日時 | 2017-03-31 22:31:09 |
言語 | D (dmd 2.105.2) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 578 bytes |
コンパイル時間 | 676 ms |
コンパイル使用メモリ | 101,868 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-03 12:39:38 |
合計ジャッジ時間 | 2,079 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,380 KB |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop; void main() { int N = readln.chomp.to!int; int zero = 'a' - 'a'; int one = 'b' - 'a'; int three = 'd' - 'a'; int five = 'f' - 'a'; for (int i = one; i < N+one; i++) { if (i % three == zero && i % five == zero) "FizzBuzz".writeln; else if (i % three == zero) "Fizz".writeln; else if (i % five == zero) "Buzz".writeln; else i.writeln; } }