結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-11-10 23:33:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 670 bytes |
| コンパイル時間 | 600 ms |
| コンパイル使用メモリ | 68,300 KB |
| 実行使用メモリ | 9,152 KB |
| 最終ジャッジ日時 | 2024-11-24 15:38:48 |
| 合計ジャッジ時間 | 4,011 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 WA * 13 |
ソースコード
#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{reverse(N_4.begin(), N_4.end());
cout << N_4 << endl;
}
return 0;
}
hamray