結果
| 問題 | No.1943 消えたAGCT(1) |
| コンテスト | |
| ユーザー |
rururun
|
| 提出日時 | 2024-11-15 12:28:12 |
| 言語 | Swift (6.2.4) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 2,000 ms |
| コード長 | 383 bytes |
| 記録 | |
| コンパイル時間 | 7,091 ms |
| コンパイル使用メモリ | 135,692 KB |
| 実行使用メモリ | 18,176 KB |
| 最終ジャッジ日時 | 2026-05-10 11:42:55 |
| 合計ジャッジ時間 | 9,224 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
Main.swift:1:11: warning: expression of type 'String' is unused [#no-usage]
1 | readLine()!
| `- warning: expression of type 'String' is unused [#no-usage]
2 | let s = readLine()!.map{String($0)}
3 | let As: Set<String> = ["A","G","C","T"]
ソースコード
readLine()!
let s = readLine()!.map{String($0)}
let As: Set<String> = ["A","G","C","T"]
var c = 0
for i in s{
if As.contains(i){
c += 1
}
}
var k = c, cnt = 0
c = c-1
while c >= 0 {
if !As.contains(s[c]){
while !As.contains(s[k]){
k += 1
cnt += 1
}
k += 1
cnt += 1
}
c -= 1
cnt += 1
}
print(cnt)
rururun