結果

問題 No.1943 消えたAGCT(1)
ユーザー harurunharurun
提出日時 2022-05-20 22:32:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 1,526 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,684 KB
最終ジャッジ日時 2024-09-20 08:46:21
合計ジャッジ時間 2,079 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 27 ms
10,880 KB
testcase_03 AC 27 ms
11,008 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 27 ms
11,556 KB
testcase_10 AC 99 ms
11,552 KB
testcase_11 AC 101 ms
11,428 KB
testcase_12 AC 27 ms
11,520 KB
testcase_13 AC 56 ms
11,232 KB
testcase_14 AC 26 ms
10,880 KB
testcase_15 AC 28 ms
11,520 KB
testcase_16 AC 28 ms
11,264 KB
testcase_17 AC 28 ms
11,416 KB
testcase_18 AC 27 ms
11,684 KB
testcase_19 AC 28 ms
11,552 KB
testcase_20 AC 27 ms
11,520 KB
testcase_21 AC 27 ms
11,560 KB
testcase_22 AC 27 ms
11,552 KB
testcase_23 AC 28 ms
11,556 KB
testcase_24 AC 101 ms
11,556 KB
testcase_25 AC 102 ms
11,556 KB
testcase_26 AC 101 ms
11,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class INPUT:
  def __init__(self):
    self._l=open(0).read().split()
    self._length=len(self._l)
    self._index=0
    return

  def stream(self,k=1,f=int,f2=False):
    assert(-1<k)
    if self._length==self._index or self._length-self._index<k:
      raise Exception("There is no input!")
    elif f!=str:
      if k==0:
        ret=list(map(f,self._l[self._index:]))
        self._index=self._length
        return ret
      if k==1 and not f2:
        ret=f(self._l[self._index])
        self._index+=1
        return ret
      if k==1 and f2:
        ret=[f(self._l[self._index])]
        self._index+=1
        return ret
      ret=[]
      for _ in [0]*k:
        ret.append(f(self._l[self._index]))
        self._index+=1
      return ret
    else:
      if k==0:
        ret=list(self._l[self._index:])
        self._index=self._length
        return ret
      if k==1 and not f2:
        ret=self._l[self._index]
        self._index+=1
        return ret
      if k==1 and f2:
        ret=[self._l[self._index]]
        self._index+=1
        return ret
      ret=[]
      for _ in [0]*k:
        ret.append(self._l[self._index])
        self._index+=1
      return ret
pin=INPUT().stream

#pin(number[default:1],f[default:int],f2[default:False])
#if number==0 -> return left all
#listを変数で受け取るとき、必ずlistをTrueにすること。

def main():
  n=pin(1)
  s=pin(1,str)
  for i in range(n-1,-1,-1):
    if s[i] in ["A","G","C","T"]:
      print(i+1)
      return
  print(0)
  return

main()
0