結果
問題 |
No.805 UMG
|
ユーザー |
![]() |
提出日時 | 2019-03-22 22:04:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 424 bytes |
コンパイル時間 | 603 ms |
コンパイル使用メモリ | 65,572 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-11-18 13:26:16 |
合計ジャッジ時間 | 20,096 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 6 WA * 14 TLE * 5 |
ソースコード
#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 (j - i == k - j>0&&s[i] == 'U'&&s[j] == 'M'&&s[k] == 'G') { l += 1; } } } } cout << l << endl; return 0; }