結果

問題 No.805 UMG
ユーザー liny_tail
提出日時 2020-10-12 20:01:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 269 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-11-18 14:07:54
合計ジャッジ時間 17,555 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input().strip())
S = input().strip()

cnt = 0

for i in range(N-2):
  n = 1
  while True:
    if n*2+i >= N:
      break
    
    #print('0:{} 1:{} 2:{}'.format(i, i+n, i+n*2))
    if S[i] + S[i+n] + S[i+n*2] == 'UMG':
      cnt += 1
    
    n+= 1

print(cnt)
0