結果

問題 No.2322 MMA文字列
ユーザー kuma0328
提出日時 2023-05-28 13:33:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 198,208 KB
最終ジャッジ日時 2025-02-13 09:50:47
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  bool flg = true;
  set<char> st;
  for (int i = 0; i < s.size(); i++) {
    if (!isalpha(s[i])) flg = false;
    st.emplace(s[i]);
  }

  if (s[0] == s[1] && st.size() == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
0