結果
問題 | No.1943 消えたAGCT(1) |
ユーザー |
|
提出日時 | 2022-05-20 21:43:28 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 2,999 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 82,140 KB |
実行使用メモリ | 271,852 KB |
最終ジャッジ日時 | 2024-09-20 07:41:25 |
合計ジャッジ時間 | 4,145 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 TLE * 1 -- * 17 |
ソースコード
# from functools import reduce # def gcd(*numbers): # return reduce(math.gcd, numbers) # readline = sys.stdin.readline # write = sys.stdout.write # flush = sys.stdout.flush # sys.setrecursionlimit(500000) # def input(): # return sys.stdin.readline()[:-1] mod = 998244353 def sum_range(n): return n * (n + 1) // 2 def yes(r=True): if r: print('Yes') def yes_exit(r=True): if r: print('Yes') exit() def no(r=True): if r: print('No') def no_exit(r=True): if r: print('No') exit() def yes_no(r): print('Yes' if r else 'No') def yes_no_exit(r): print('Yes' if r else 'No') exit() # S = input() N = int(input()) # H = int(input()) # K = int(input()) # Q = int(input()) # T = int(input()) # W = int(input()) # X = int(input()) # N = input() # S = input() # S1 = input() # S2 = input() # S3 = input() # T = input() # N, K = map(int, input().split()) # N, M = map(int, input().split()) # N, Q = map(int, input().split()) # N, W = map(int, input().split()) # N, X = map(int, input().split()) # H, W = map(int, input().split()) # R, C = map(int, input().split()) # L, R = map(int, input().split()) # a, b = map(int, input().split()) # a, N = map(int, input().split()) # N, X, Y = map(int, input().split()) # N, A, B = map(int, input().split()) # A, B, K = map(int, input().split()) # N, M, K = map(int, input().split()) # V, A, B, C = map(int, input().split()) # A, B, C, D = map(int, input().split()) # A, B, C, X = map(int, input().split()) # N, M, K, S, T, X = map(int, input().split()) # A = list(map(int, input().split())) # C = list(map(int, input().split())) # H = list(map(int, input().split())) # T = list(map(int, input().split())) # P = list(map(lambda x: int(x) - 1, input().split())) # S = input() # Q = int(input()) # A = input().split() # S = input().split() # T = input().split() # N = list(input()) # S = list(input()) # X = [int(input()) for _ in range(N)] # X = [int(input()) for _ in range(Q)] # A = [input().split() for _ in range(N)] # A = [list(map(int, input().split())) for _ in range(N)] # A = [list(map(int, input().split())) for _ in range(H)] # G = [list(map(int, input().split())) for _ in range(M)] # querys = [list(map(int, input().split())) for _ in range(Q)] # querys = [input() for _ in range(Q)] # T = [list(map('.#'.index, input())) for _ in range(H)] # S = list(map('LR'.index, input())) # S = list(map('ULR'.index, input())) def main(): # import collections # import math # import queue # import random # import copy # import sys pass chars = ("A","G","C","T") c = 0 S = input() for s in S: if s in ("A","G","C","T"): c += 1 if not c: return 0 for i in range(N): if S[c-1] in chars: S = S[:c-1] + S[c:] c -= 1 else: S = S[:c-1] + S[c:] if c == 0: return i + 1 if __name__ == "__main__": print(main())