結果
問題 |
No.805 UMG
|
ユーザー |
|
提出日時 | 2019-04-19 23:38:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 290 bytes |
コンパイル時間 | 671 ms |
コンパイル使用メモリ | 64,600 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-18 13:44:40 |
合計ジャッジ時間 | 1,541 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 5 WA * 20 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; string s; int ans; main() { cin>>s; for(int i=0;i<s.size();i++) { if(s[i]!='M')continue; for(int j=1;i-j>=0&&i+j<s.size();j++) { if(s[i-j]=='U'&&s[i+j]=='G')ans++; } } cout<<ans<<endl; }