結果

問題 No.1943 消えたAGCT(1)
ユーザー soragsorag
提出日時 2022-08-20 16:39:08
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 1,328 ms
コンパイル使用メモリ 110,348 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-04-17 15:08:00
合計ジャッジ時間 5,400 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 RE -
testcase_05 AC 1 ms
6,940 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,944 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 TLE -
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 #

#include <iostream>
#include<utility>
#include <vector>
#include <map>
#include<string>
#include<queue>
#include<math.h>
#define pb push_back
#define all(x) begin(x),end(x)
#define ll long long
#define P pair<int,int>
#define lP pait<ll,ll>
using namespace std;
int main() {
    int n,ans=0;
    string s;
    cin>>n>>s;
    int x=s.size();
    for(int i=0;i<x;i++){
        int cnt=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='A' or s[i]=='G' or
           s[i]=='C' or s[i]=='T' ) cnt++;
    }
        if(cnt==0) continue;
        else {
        s.erase(cnt+1,1);
        ans++;
    }
    }
    cout<<ans<<endl;
    return 0;
}
0