No.311 z in FizzBuzzString
レベル :
/ AI推定難易度 : 167
/ 実行時間制限 : 1ケース 1.500秒 / メモリ制限
: 256 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 745
作問者 :
ciel
タグ : / 解いたユーザー数 745
作問者 :
問題文最終更新日: 2026-06-25 12:46:11
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Advent Calendar Contest 2015
(順位表)
の他の問題:
Problem Statement
For the numbers from 1 to N, convert each as follows:
- Multiple of both 3 and 5: FizzBuzz
- Multiple of 3: Fizz
- Multiple of 5: Buzz
- Otherwise: the number itself
Note: Since 64-bit integer values are used, answering in JavaScript may be difficult.
In PHP, you will likely need to use the
In PHP, you will likely need to use the
divint function instead of /.
Input
N
N is given on one line. 1<=N<=10^18
Output
Output the number of 'z' characters on one line.
Sample
Sample 1
Input
15
Output
16
FizzBuzzString(15)="12Fizz4BuzzFizz78FizzBuzz11Fizz1314FizzBuzz", and the number of 'z' characters contained in it is 16.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。