Submission #33909


Source Code Expand

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

namespace atcoder006_a
{
    class Program
    {
        static void Main(string[] args)
        {
            //変数宣言
            int intTokyu = 0; 
            
            string strTosenNo = Console.ReadLine();
            string strBonusNo = Console.ReadLine();
            string strSetNo = Console.ReadLine();

            if (blnCheckTokyuOne(strTosenNo, strSetNo) == 0)
            {
                intTokyu = 1;
            }
            else if (blnCheckTokyuTwo(strTosenNo, strSetNo, strBonusNo) == 0)
            {
                intTokyu = 2;
            }
            else
            {
                intTokyu = blnCheckTokyuElse(strTosenNo, strSetNo);
            }
            
            Console.WriteLine(intTokyu);
        }

        static int blnCheckTokyuOne(string strTosenNo, string strSetNo)
        {
            if (strTosenNo == strSetNo)
            {
                return 0;
            }
            else
            {
                return -1;
            }
        }

        static int blnCheckTokyuTwo(string strTosenNo, string strSetNo,string strBonusNo)
        {
            int intCount;
            int intFindCount;

            intFindCount = 0;

            for (intCount = 0; intCount < 6; intCount++)
            {
                if (HasString(strTosenNo, strSetNo.Substring(intCount, 1)) == true)
                {
                    intFindCount++;
                }
            }
            if (intFindCount == 5)
            {
                if (HasString(strSetNo,strBonusNo) == true)
                {
                    return 0;
                }
            }
            return -1;

        }

        static int blnCheckTokyuElse(string strTosenNo, string strSetNo)
        {
            int intCount;
            int intFindCount;

            intFindCount = 0;

            for (intCount = 0; intCount < 6; intCount++)
            {
                if (HasString(strTosenNo,strSetNo.Substring(intCount, 1) ) == true)
                {
                    intFindCount++;
                }
            }
            if (intFindCount > 2)
            {
                switch (intFindCount)
                {
                    case 5:
                        return 3;
                    case 4:
                        return 4;
                    case 3:
                        return 5;
                }
            }else
            {
                return 0;
            }
            return 0;

        }

        static bool HasString(string target, string word)
        {
            if (word == "")
                return false;
            if (target.IndexOf(word) >= 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}

Submission Info

Submission Time
Task A - 宝くじ
User iemon
Language C# (Mono 2.10.8.1)
Score 0
Code Size 3021 Byte
Status WA
Exec Time 165 ms
Memory 8408 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 20
WA × 31
Set Name Test Cases
All 00_1_01.txt, 00_1_02.txt, 00_2_01.txt, 00_2_02.txt, 00_3_01.txt, 00_3_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 01_rand_30.txt, 01_rand_31.txt, 01_rand_32.txt, 01_rand_33.txt, 01_rand_34.txt, 01_rand_35.txt, 01_rand_36.txt, 01_rand_37.txt, 01_rand_38.txt, 01_rand_39.txt
Case Name Status Exec Time Memory
00_1_01.txt AC 141 ms 7740 KB
00_1_02.txt AC 154 ms 7716 KB
00_2_01.txt WA 156 ms 8332 KB
00_2_02.txt AC 156 ms 8296 KB
00_3_01.txt WA 156 ms 8332 KB
00_3_02.txt AC 157 ms 8332 KB
00_sample_01.txt AC 133 ms 7724 KB
00_sample_02.txt WA 150 ms 8392 KB
00_sample_03.txt AC 155 ms 8328 KB
00_sample_04.txt WA 153 ms 8292 KB
00_sample_05.txt WA 148 ms 8328 KB
01_rand_00.txt WA 148 ms 8296 KB
01_rand_01.txt AC 152 ms 8328 KB
01_rand_02.txt WA 153 ms 8332 KB
01_rand_03.txt AC 146 ms 8336 KB
01_rand_04.txt WA 161 ms 8324 KB
01_rand_05.txt WA 150 ms 8356 KB
01_rand_06.txt WA 150 ms 8288 KB
01_rand_07.txt AC 151 ms 8324 KB
01_rand_08.txt WA 149 ms 8328 KB
01_rand_09.txt AC 154 ms 8320 KB
01_rand_10.txt AC 153 ms 8328 KB
01_rand_11.txt WA 149 ms 8332 KB
01_rand_12.txt WA 160 ms 8332 KB
01_rand_13.txt WA 160 ms 8328 KB
01_rand_14.txt WA 165 ms 8264 KB
01_rand_15.txt WA 163 ms 8328 KB
01_rand_16.txt WA 157 ms 8332 KB
01_rand_17.txt AC 163 ms 8332 KB
01_rand_18.txt WA 163 ms 8324 KB
01_rand_19.txt WA 156 ms 8324 KB
01_rand_20.txt WA 159 ms 8328 KB
01_rand_21.txt AC 153 ms 8324 KB
01_rand_22.txt WA 154 ms 8296 KB
01_rand_23.txt AC 151 ms 8328 KB
01_rand_24.txt AC 148 ms 8328 KB
01_rand_25.txt WA 160 ms 8328 KB
01_rand_26.txt WA 160 ms 8408 KB
01_rand_27.txt AC 155 ms 8320 KB
01_rand_28.txt WA 149 ms 8316 KB
01_rand_29.txt AC 154 ms 8324 KB
01_rand_30.txt AC 152 ms 8368 KB
01_rand_31.txt WA 153 ms 8312 KB
01_rand_32.txt WA 160 ms 8352 KB
01_rand_33.txt WA 154 ms 8348 KB
01_rand_34.txt AC 153 ms 8300 KB
01_rand_35.txt WA 154 ms 8320 KB
01_rand_36.txt AC 155 ms 8312 KB
01_rand_37.txt WA 158 ms 8324 KB
01_rand_38.txt WA 152 ms 8408 KB
01_rand_39.txt WA 152 ms 8316 KB