結果
| 問題 | No.1943 消えたAGCT(1) |
| コンテスト | |
| ユーザー |
rururun
|
| 提出日時 | 2024-11-15 12:28:12 |
| 言語 | Swift (6.3.3) |
| 結果 |
AC
不安定
|
| 実行時間 | 58 ms / 2,000 ms |
| + 809µs | |
| コード長 | 383 bytes |
| 記録 | |
| コンパイル時間 | 11,160 ms |
| コンパイル使用メモリ | 137,896 KB |
| 実行使用メモリ | 18,352 KB |
| 最終ジャッジ日時 | 2026-09-23 05:44:13 |
| 合計ジャッジ時間 | 10,469 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_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