結果

問題 No.1943 消えたAGCT(1)
ユーザー mobchanmobchan
提出日時 2023-05-07 13:37:30
言語 C#
(.NET 8.0.203)
結果
TLE  
実行時間 -
コード長 835 bytes
コンパイル時間 12,289 ms
コンパイル使用メモリ 146,144 KB
実行使用メモリ 37,668 KB
最終ジャッジ日時 2023-08-16 04:02:42
合計ジャッジ時間 18,612 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
30,780 KB
testcase_01 AC 49 ms
28,652 KB
testcase_02 AC 48 ms
28,536 KB
testcase_03 AC 47 ms
28,912 KB
testcase_04 AC 47 ms
28,784 KB
testcase_05 AC 46 ms
28,916 KB
testcase_06 AC 46 ms
28,384 KB
testcase_07 AC 47 ms
28,424 KB
testcase_08 AC 46 ms
28,824 KB
testcase_09 AC 59 ms
32,784 KB
testcase_10 AC 58 ms
32,652 KB
testcase_11 AC 58 ms
32,608 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 127 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;

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


        while (count != 0)
        {
            if (s[count - 1] == 'A' || s[count - 1] == 'C' || s[count - 1] == 'G' || s[count - 1] == 'T')
            {
                s.RemoveAt(count - 1);
                times++;
                count--;
            }
            else
            {
                s.RemoveAt(count - 1);
                times++;
            }
        }

        Console.WriteLine(times);
    }
}
0