結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-11-10 23:31:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 637 bytes |
| コンパイル時間 | 730 ms |
| コンパイル使用メモリ | 68,344 KB |
| 実行使用メモリ | 9,160 KB |
| 最終ジャッジ日時 | 2024-11-24 15:37:48 |
| 合計ジャッジ時間 | 3,108 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 10 WA * 21 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include<math.h>
using namespace std;
int main() {
string N_4; cin >> N_4;
int N_10 = 0;
reverse(N_4.begin(), N_4.end());
for(int i = 0; i < N_4.size(); i++){
N_10 = (N_4[i] - '0') * pow(4, i) + N_10;
}
if(N_10 % 3 == 0 && N_10 % 5 == 0){
cout << "FizzBuzz" << endl;
}else if(N_10 % 3 == 0){
cout << "Fizz" << endl;
}else if(N_10 % 5 == 0){
cout << "Buzz" << endl;
}else{
cout << N_10 << endl;
}
return 0;
}
hamray