結果

問題 No.1943 消えたAGCT(1)
ユーザー 👑 tatt61880tatt61880
提出日時 2023-03-13 23:43:02
言語 Kuin
(KuinC++ v.2021.9.17)
結果
TLE  
実行時間 -
コード長 595 bytes
コンパイル時間 6,112 ms
コンパイル使用メモリ 146,296 KB
実行使用メモリ 11,360 KB
最終ジャッジ日時 2023-10-18 11:25:12
合計ジャッジ時間 7,947 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
11,360 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var s: []char :: cui@input()
	
	var lis: list<char> :: #list<char>
	
	var cnt: int :: 0
	for i(0, ^s - 1)
		var c: char :: s[i]
		do lis.add(c)
		switch(c)
		case 'A', 'G', 'C', 'T'
			do cnt :+ 1
		end switch
	end for
	
	do lis.head()
	do lis.moveOffset(cnt - 1)
	
	var ans: int :: 0
	while(cnt <> 0)
		do ans :+ 1
		var c: char :: lis.get()
		switch(c)
		case 'A', 'G', 'C', 'T'
			if(lis.idx() <> 0)
				do lis.prev()
				do lis.delNext()
			end if
			do cnt :- 1
		default
			do lis.del()
		end switch
	end while
	do cui@print("\{ans}\n")
end func
0