結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
mtsd
|
| 提出日時 | 2017-11-10 22:40:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 2,000 ms |
| コード長 | 697 bytes |
| コンパイル時間 | 913 ms |
| コンパイル使用メモリ | 72,504 KB |
| 実行使用メモリ | 7,316 KB |
| 最終ジャッジ日時 | 2024-11-24 12:56:45 |
| 合計ジャッジ時間 | 3,296 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 31 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define MP make_pair
#define PB push_back
#define inf 1000000007
int main(){
string s;
cin >> s;
int n = s.size();
int x=0,y=0;
for(int i=0;i<n;i++){
x += s[i]-'0';
if(i%2==0){
y += s[i]-'0';
}else{
y -= s[i]-'0';
}
}
bool flag = 0;
if(x%3==0){
flag = 1;
cout << "Fizz";
}
if((40000000+y)%5==0){
flag = 1;
cout << "Buzz";
}
if(!flag){
cout << s;
}
cout << endl;
return 0;
}
mtsd