結果

問題 No.182 新規性の虜
ユーザー funakoshifunakoshi
提出日時 2019-06-26 10:54:51
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,171 bytes
コンパイル時間 2,803 ms
コンパイル使用メモリ 101,688 KB
実行使用メモリ 29,700 KB
最終ジャッジ日時 2023-09-06 16:03:10
合計ジャッジ時間 6,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,684 KB
testcase_01 AC 54 ms
20,588 KB
testcase_02 AC 56 ms
22,660 KB
testcase_03 AC 56 ms
22,632 KB
testcase_04 AC 55 ms
20,592 KB
testcase_05 AC 55 ms
22,636 KB
testcase_06 AC 55 ms
20,708 KB
testcase_07 AC 55 ms
18,772 KB
testcase_08 AC 81 ms
25,580 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 54 ms
22,640 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 55 ms
20,868 KB
testcase_24 AC 89 ms
26,904 KB
testcase_25 AC 81 ms
25,364 KB
testcase_26 AC 66 ms
21,536 KB
testcase_27 AC 55 ms
22,712 KB
evil01.txt AC 94 ms
28,588 KB
evil02.txt AC 94 ms
28,488 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.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string findlist = Console.ReadLine();
            string[] list = findlist.Split(' ');
            int[] num = new int[list.Length];
            int Newcnt = int.Parse(input);
            bool flg = false;
            for (int i = 0; i < num.Length; i++)
            {
                num[i] = int.Parse(list[i]);
            }
            for (int i = 0; i < num.Length - 1; i++)
            {
                if (num[i] == num[i + 1])
                {
                    if (flg == false)
                    {
                        Newcnt -= 2;
                        flg = true;
                    }
                    else
                    {
                        Newcnt--;
                    }
                }
                else
                {
                    flg = false;
                }

            }

            Console.WriteLine(Newcnt);
        }

    }
}
0