結果

問題 No.805 UMG
ユーザー sigmani
提出日時 2022-03-08 20:13:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 1,723 ms
コンパイル使用メモリ 167,508 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-18 14:14:55
合計ジャッジ時間 2,746 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  string S;
  cin>>S;
  long long count=0;
  for(int i=0;i<=N-1;i++){
    for(int j=0;j<=N-1;j++){
      if(S[i]=='U'&&S[j]=='M'&&S[2*j-i]=='G')count++;
    }
  }
  cout<<count;
}
0