結果

問題 No.805 UMG
ユーザー hato3617
提出日時 2019-03-22 22:27:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 65,644 KB
実行使用メモリ 13,636 KB
最終ジャッジ日時 2024-11-18 13:27:46
合計ジャッジ時間 19,456 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 15 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<cstdio>
using namespace std;

int main(){
	int n;
	cin >> n;
	string s;
	cin >> s;
	int l = 0;
	for (int i = 0; i < n-2; i++) {
		for (int j= 1; j < n-1 ; j++) {
			for (int k = 2; k < n; k++) {
				if (j - i == k - j && s[i] == 'U'&&s[j] == 'M'&&s[k] == 'G') {
					l += 1;
				}
			}
		

		}
	}
	cout << l << endl;
	return 0;
}
0