結果
問題 | No.593 4進FizzBuzz |
ユーザー |
![]() |
提出日時 | 2017-12-24 09:06:48 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 583 bytes |
コンパイル時間 | 753 ms |
コンパイル使用メモリ | 66,340 KB |
実行使用メモリ | 9,168 KB |
最終ジャッジ日時 | 2024-12-17 18:24:14 |
合計ジャッジ時間 | 3,414 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 WA * 13 |
ソースコード
#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'; }*/ 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; } } 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; }