結果

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