提出 #27599955


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main(){

    //入力
    string S;
    cin >> S;

    //文字の長さ
    int N = S.length();
    
    int ans = 0;
    int cnt = 0;

    set<char>st ={'A', 'C', 'G', 'T'};

    for(int i = 0; i < N; i++){
        if(st.count(S[i])){
            cnt++;
            ans = max(ans,cnt);
        }else{
            cnt = 0;
        }
    }

    cout << ans << endl;
    return 0;
}

提出情報

提出日時
問題 B - ATCoder
ユーザ macle
言語 C++ (GCC 9.2.1)
得点 200
コード長 460 Byte
結果 AC
実行時間 5 ms
メモリ 3600 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 13
セット名 テストケース
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
ケース名 結果 実行時間 メモリ
a01 AC 5 ms 3500 KiB
a02 AC 2 ms 3596 KiB
a03 AC 2 ms 3456 KiB
b04 AC 2 ms 3520 KiB
b05 AC 2 ms 3432 KiB
b06 AC 2 ms 3596 KiB
b07 AC 2 ms 3592 KiB
b08 AC 2 ms 3400 KiB
b09 AC 2 ms 3600 KiB
b10 AC 2 ms 3432 KiB
b11 AC 2 ms 3380 KiB
b12 AC 2 ms 3400 KiB
b13 AC 2 ms 3592 KiB