結果

問題 No.1943 消えたAGCT(1)
ユーザー mobchanmobchan
提出日時 2023-05-06 19:40:59
言語 C#
(.NET 8.0.404)
結果
TLE  
実行時間 -
コード長 626 bytes
コンパイル時間 8,652 ms
コンパイル使用メモリ 168,720 KB
実行使用メモリ 82,048 KB
最終ジャッジ日時 2024-11-24 01:30:54
合計ジャッジ時間 47,660 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 TLE * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (110 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.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 < s.Count; 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