結果

問題 No.593 4進FizzBuzz
ユーザー Mcpu3Mcpu3
提出日時 2018-08-31 17:05:05
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 935 ms
コンパイル使用メモリ 28,928 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-11 22:51:58
合計ジャッジ時間 3,695 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 0 ms
4,352 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 0 ms
4,352 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 0 ms
4,352 KB
testcase_12 AC 0 ms
4,352 KB
testcase_13 AC 0 ms
4,352 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,352 KB
testcase_16 AC 10 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 11 ms
4,348 KB
testcase_19 AC 11 ms
4,352 KB
testcase_20 WA -
testcase_21 AC 10 ms
4,348 KB
testcase_22 AC 11 ms
4,348 KB
testcase_23 AC 10 ms
4,348 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 11 ms
4,348 KB
testcase_27 AC 11 ms
4,352 KB
testcase_28 AC 11 ms
4,352 KB
testcase_29 AC 12 ms
4,348 KB
testcase_30 AC 10 ms
4,356 KB
testcase_31 AC 10 ms
4,348 KB
testcase_32 AC 10 ms
4,352 KB
testcase_33 AC 12 ms
4,348 KB
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int three(int o,int e)
{
    if((o+e)%3)return 0;
    else return 1;
}

int eleven(int o,int e)
{
    if(o!=e&&(o+e)%11)return 0;
    else return 1;
}

int main(void)
{
    char n[2000001];
    int o=0,e=0,i;
    scanf("%s",n);
    for(i=strlen(n);i>0;i--){
        if(i%2)o+=n[i-1]-'0';
        else e+=n[i-1]-'0';
    }
    if(three(o,e)&&eleven(o,e))puts("FizzBuzz");
    else if(three(o,e))puts("Fizz");
    else if(eleven(o,e))puts("Buzz");
    else puts(n);
    return 0;
}
0