結果

問題 No.1943 消えたAGCT(1)
ユーザー mnmmnm
提出日時 2022-05-24 19:51:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 560 bytes
コンパイル時間 633 ms
コンパイル使用メモリ 74,980 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-20 14:30:18
合計ジャッジ時間 20,366 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#define rep(i,n) for(i=0; i<n; ++i)
#define in(a) cin >> a
#define out(a,b) cout << a << b
using namespace std;
using lint = long long;

int main(void){
    int i, j, n, m, k, cnt = 0;
    string s, u="AGCT";
    char let;
    int c=0;
    in(n);
    in(s);
    rep(i,n){
        rep(j,4)    c+=s[i]==u[j];
    }
    while(c){
        cnt++;
        let = s[c-1];
        s.erase(c-1,1);
        rep(i,4)    c-=let==u[i];
    }
    out(cnt,endl);

    return 0;
}

0