結果

問題 No.1943 消えたAGCT(1)
ユーザー tnakao0123
提出日時 2022-05-20 23:08:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 40,620 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-20 09:31:53
合計ジャッジ時間 1,463 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1943.cc:  No.1943 消えたAGCT(1) - yukicoder
 */

#include<cstdio>
#include<algorithm>
 
using namespace std;

/* constant */

const int MAX_N = 500000;

/* typedef */

/* global variables */

bool cmap[128];
char s[MAX_N + 4];

/* subroutines */

/* main */

int main() {
  cmap['A'] = cmap['G'] = cmap['C'] = cmap['T'] = true;

  int n;
  scanf("%d%s", &n, s);

  int k = n - 1;
  while (k >= 0 && ! cmap[s[k]]) k--;

  printf("%d\n", k + 1);
  return 0;
}
0