結果

問題 No.805 UMG
ユーザー hato3617
提出日時 2019-03-22 22:23:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 616 ms
コンパイル使用メモリ 66,160 KB
実行使用メモリ 13,640 KB
最終ジャッジ日時 2024-11-18 13:27:21
合計ジャッジ時間 17,005 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 17 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; i++) {
		for (int j= 0; j < i ; j++) {
			for (int k = 0; k < j; k++) {
				if (j - i == k - j && s[i] == 'U'&&s[j] == 'M'&&s[k] == 'G') {
					l += 1;
				}
			}
		

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