結果
| 問題 |
No.1943 消えたAGCT(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-07 13:37:30 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 835 bytes |
| コンパイル時間 | 9,088 ms |
| コンパイル使用メモリ | 168,320 KB |
| 実行使用メモリ | 73,088 KB |
| 最終ジャッジ日時 | 2024-11-24 13:45:03 |
| 合計ジャッジ時間 | 38,754 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 TLE * 8 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (84 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/
ソースコード
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);
}
}