結果
| 問題 |
No.8061 uxs hxixtya pyuyn ixc hyixa kxuyn
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-01 21:46:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 536 bytes |
| コンパイル時間 | 2,714 ms |
| コンパイル使用メモリ | 199,316 KB |
| 最終ジャッジ日時 | 2025-01-09 11:52:17 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
getline(cin, S);
int cnt[300] = {0};
for(char c : S) cnt[c]++;
int N = S.size();
for(int i=0; i<N; i++) for(int j=i; j<N-1; j+=2){
map<char, int> mp;
for(int k=i; k<=j; k+=2) mp[S[k]]++;
bool ok = true;
for(auto& p : mp) if(p.first == ' ' || cnt[p.first] != p.second) ok = false;
if(ok){
cout << "Yes" << endl;
return 0;
}
}
cout << "NO" << endl;
return 0;
}