結果
| 問題 |
No.311 z in FizzBuzzString
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-04 03:15:39 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 635 bytes |
| コンパイル時間 | 136 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 61,728 KB |
| 最終ジャッジ日時 | 2024-09-24 21:15:06 |
| 合計ジャッジ時間 | 3,343 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 TLE * 1 -- * 3 |
ソースコード
def getFizzBuzzString(num):
text = ''
for i in range(num):
cur = i + 1
if ((cur % 15) == 0):
text = text + 'FizzBuzz'
elif ((cur % 5) == 0):
text = text + 'Buzz'
elif ((cur % 3) == 0):
text = text + 'Fizz'
else:
text = text + str(i)
return text
def count(text):
count = 0
for w in text:
if w == 'z':
count = count + 1
return count
input = input()
split_input = input.split()
number = int(split_input[0])
if (1 <= number and number <= 10 ** 18):
text = getFizzBuzzString(number)
print(count(text))