結果

問題 No.593 4進FizzBuzz
ユーザー kuuso1kuuso1
提出日時 2017-11-10 22:37:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 1,353 bytes
コンパイル時間 3,347 ms
コンパイル使用メモリ 107,464 KB
実行使用メモリ 29,952 KB
最終ジャッジ日時 2023-08-16 03:17:45
合計ジャッジ時間 7,209 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
20,432 KB
testcase_01 AC 49 ms
20,384 KB
testcase_02 AC 49 ms
22,492 KB
testcase_03 AC 49 ms
22,628 KB
testcase_04 AC 49 ms
22,480 KB
testcase_05 AC 49 ms
20,444 KB
testcase_06 AC 49 ms
20,656 KB
testcase_07 AC 50 ms
22,608 KB
testcase_08 AC 49 ms
20,444 KB
testcase_09 AC 49 ms
22,472 KB
testcase_10 AC 49 ms
20,620 KB
testcase_11 AC 49 ms
20,500 KB
testcase_12 AC 49 ms
18,544 KB
testcase_13 AC 52 ms
22,504 KB
testcase_14 AC 50 ms
20,448 KB
testcase_15 AC 49 ms
20,624 KB
testcase_16 AC 90 ms
27,860 KB
testcase_17 AC 90 ms
29,832 KB
testcase_18 AC 92 ms
29,820 KB
testcase_19 AC 97 ms
27,868 KB
testcase_20 AC 91 ms
27,860 KB
testcase_21 AC 90 ms
25,876 KB
testcase_22 AC 97 ms
28,060 KB
testcase_23 AC 90 ms
27,756 KB
testcase_24 AC 91 ms
27,820 KB
testcase_25 AC 91 ms
29,900 KB
testcase_26 AC 98 ms
29,896 KB
testcase_27 AC 97 ms
27,788 KB
testcase_28 AC 90 ms
27,768 KB
testcase_29 AC 99 ms
29,860 KB
testcase_30 AC 91 ms
27,828 KB
testcase_31 AC 91 ms
29,816 KB
testcase_32 AC 92 ms
29,952 KB
testcase_33 AC 98 ms
28,044 KB
testcase_34 AC 90 ms
29,892 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int a = 0;
		int keta = 1;
		int mod = 15;
		int N = S.Length;
		for(int i=N-1;i>=0;i--){
			int num = S[i] - '0';
			a += num * keta;
			a %= mod;
			keta *= 4;
			keta %= mod;
		}
		
		switch(a){
			case 3:
			case 6:
			case 9:
			case 12:
				Console.WriteLine("Fizz"); break;
			case 5:
			case 10:
				Console.WriteLine("Buzz"); break;
			case 0:
				Console.WriteLine("FizzBuzz"); break;
			default:
				Console.WriteLine(S);
				break;
		}
		
		
	}
	String S;
	public Sol(){
		S = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}
0