結果

問題 No.785 色食い虫
ユーザー mame_shibemame_shibe
提出日時 2019-12-07 20:00:31
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 1,583 bytes
コンパイル時間 1,618 ms
コンパイル使用メモリ 61,020 KB
実行使用メモリ 25,352 KB
最終ジャッジ日時 2023-08-27 00:53:17
合計ジャッジ時間 5,819 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
19,128 KB
testcase_01 AC 69 ms
21,196 KB
testcase_02 AC 67 ms
21,092 KB
testcase_03 AC 53 ms
22,812 KB
testcase_04 AC 69 ms
25,228 KB
testcase_05 AC 68 ms
25,180 KB
testcase_06 AC 69 ms
23,224 KB
testcase_07 AC 54 ms
24,720 KB
testcase_08 AC 54 ms
22,756 KB
testcase_09 AC 71 ms
23,260 KB
testcase_10 AC 71 ms
23,252 KB
testcase_11 AC 69 ms
23,352 KB
testcase_12 AC 69 ms
21,444 KB
testcase_13 AC 68 ms
23,268 KB
testcase_14 AC 69 ms
23,140 KB
testcase_15 AC 69 ms
25,352 KB
testcase_16 AC 70 ms
23,244 KB
testcase_17 AC 78 ms
23,108 KB
testcase_18 AC 79 ms
23,328 KB
testcase_19 AC 78 ms
23,172 KB
testcase_20 AC 73 ms
23,416 KB
testcase_21 AC 73 ms
25,204 KB
testcase_22 AC 70 ms
23,272 KB
testcase_23 AC 69 ms
25,196 KB
testcase_24 AC 72 ms
21,100 KB
testcase_25 AC 72 ms
23,112 KB
testcase_26 AC 69 ms
23,144 KB
testcase_27 AC 70 ms
23,252 KB
testcase_28 AC 71 ms
23,212 KB
testcase_29 AC 73 ms
23,236 KB
testcase_30 AC 54 ms
22,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using static System.Console;
using static System.Math;

namespace YukiCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve();
        }

        public void Solve()
        {
            string R = ReadLine();
            string G = ReadLine();
            string B = ReadLine();
            long r, g, b;
            
            WriteLine(CalcRGB(R) * CalcRGB(G) * CalcRGB(B));

        }

        public static double CalcRGB(string R)
        {
            double n = 0;
            if (R.Contains(","))
            {
                n = 15 - CountOf(R, ",");
            }
            else
            {
                n = 15;
                if (R == "NONE")
                {
                    n = 16;
                }
        
            }
            
            return Pow(n,2);
        }

                        

            
        /// <summary>
        /// 指定した文字列がいくつあるか
        /// </summary>
        public static int CountOf(string target, params string[] strArray){
          int count = 0;
        
          foreach (string str in strArray) {
            int index = target.IndexOf (str, 0);
            while (index != -1) {
              count++;
              index = target.IndexOf (str, index + str.Length);
            }
          }
        
          return count;
        }  
    }
}
0