結果
問題 | No.593 4進FizzBuzz |
ユーザー |
![]() |
提出日時 | 2017-11-11 00:27:46 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 667 bytes |
コンパイル時間 | 640 ms |
コンパイル使用メモリ | 68,288 KB |
実行使用メモリ | 7,312 KB |
最終ジャッジ日時 | 2024-11-24 16:10:17 |
合計ジャッジ時間 | 4,394 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }