結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
newlife171128
|
| 提出日時 | 2017-12-24 09:17:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 602 bytes |
| コンパイル時間 | 643 ms |
| コンパイル使用メモリ | 65,868 KB |
| 実行使用メモリ | 9,080 KB |
| 最終ジャッジ日時 | 2024-12-17 18:24:23 |
| 合計ジャッジ時間 | 3,213 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 31 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
using namespace std;
int main() {
string s ;
cin>>s;
/* int digit[s.length()];
for(int i=0;i<s.length();i++){
digit[i] = s[i]-'0';
}*/
unsigned long long ans =0;
for(int i=s.length()-1;i>=0;i--){
if(i==0){
ans = (ans+(s[i]-'0'));
}else {
ans = (ans+(s[i]-'0'))*4;
}
}
cout<<ans;
if(ans %15 ==0){
cout<<"FizzBuzz"<<endl;
}else if (ans %3 ==0) {
cout<<"Fizz"<<endl;
}else if (ans % 5==0) {
cout<<"Buzz"<<endl;
}else {
cout<<s<<endl;
}
return 0;
}
newlife171128