結果

問題 No.1943 消えたAGCT(1)
ユーザー mobchanmobchan
提出日時 2023-05-06 19:37:51
言語 C#
(.NET 8.0.203)
結果
RE  
実行時間 -
コード長 620 bytes
コンパイル時間 13,978 ms
コンパイル使用メモリ 144,092 KB
実行使用メモリ 166,400 KB
最終ジャッジ日時 2023-08-15 17:26:02
合計ジャッジ時間 22,882 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 44 ms
28,780 KB
testcase_04 RE -
testcase_05 AC 47 ms
30,848 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 53 ms
32,900 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 51 ms
166,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 188 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

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

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine().ToList();

        var count = 0;
        var times = 0;

        while (true)
        {
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') count++;
            }

            if (count == 0) break;

            s.RemoveAt(count - 1);
            times++;
            count = 0;
        }
        Console.WriteLine(times);
    }
}
0