結果
| 問題 |
No.593 4進FizzBuzz
|
| コンテスト | |
| ユーザー |
mtsd
|
| 提出日時 | 2017-11-10 22:30:38 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 697 bytes |
| コンパイル時間 | 493 ms |
| コンパイル使用メモリ | 72,648 KB |
| 実行使用メモリ | 9,068 KB |
| 最終ジャッジ日時 | 2024-11-24 12:35:30 |
| 合計ジャッジ時間 | 2,903 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 WA * 7 |
ソースコード
#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)%4==0){
flag = 1;
cout << "Buzz";
}
if(!flag){
cout << s;
}
cout << endl;
return 0;
}
mtsd