Submission #60045227


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793238462643383279502884L
#define LL long long
#define DD double
#define ULL unsigned long long
#define STR string
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
#define MLL map<LL, LL>
#define MSL map<STR, LL>
#define MLB map<LL, bool>
template <class T>
using PQA = priority_queue<T, V<T>, greater<T>>;
template <class T>
using PQD = priority_queue<T, V<T>, less<T>>;
#define IT iterator
#define F first
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>

using namespace std;
#define PI 3.141592653589793238462643383279502884L
#define LL long long
#define DD double
#define ULL unsigned long long
#define STR string
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
#define MLL map<LL, LL>
#define MSL map<STR, LL>
#define MLB map<LL, bool>
template <class T>
using PQA = priority_queue<T, V<T>, greater<T>>;
template <class T>
using PQD = priority_queue<T, V<T>, less<T>>;
#define IT iterator
#define F first
#define S second
#define PB push_back
#define PLL pair<LL, LL>
#define MP make_pair
#define rep(i, e) for (LL i = 0; i < e; i++)
#define repa(i, s, e) for (LL i = s; i < e; i++)
#define repd(i, s, e) for (LL i = s; i >= e; i--)
#define repauto(x, s) for (auto x : s)
#define rd(...) \
  __VA_ARGS__;  \
  read(__VA_ARGS__)
#define rdv(value, ...) \
  value(__VA_ARGS__);   \
  cin >> value
template <class T>
auto &operator>>(istream &is, vector<T> &xs)
{
  for (auto &x : xs)
    is >> x;
  return is;
}
template <class T>
auto &operator<<(ostream &os, vector<T> &xs)
{
  int sz = xs.size();
  rep(i, sz) os << xs[i] << " \n"[i + 1 == sz];
  return os;
}
template <class T, class Y>
auto &operator<<(ostream &os, pair<T, Y> &xs)
{
  os << "{" << xs.first << ", " << xs.second << "}";
  return os;
}
template <class T, class Y>
auto &operator>>(istream &is, vector<pair<T, Y>> &xs)
{
  for (auto &[x1, x2] : xs)
    is >> x1 >> x2;
  return is;
}
template <class... Args>
auto &read(Args &...args) { return (cin >> ... >> args); }
#define vsorta(v) sort(v.begin(), v.end())
#define vsortd(v) sort(v.begin(), v.end(), greater<>())
#define sort_arr(v, n) sort(v, v + n)
#define rev(v) reverse(v.begin(), v.end())
#define pr(x) cout << x
#define prs(x) cout << x << ' '
#define prn(x) cout << x << '\n'
#define prd() cout << fixed << setprecision(50);
#define Yes cout << "Yes\n"
#define YES cout << "YES\n"
#define No cout << "No\n"
#define NO cout << "NO\n"
#define PN cout << '\n'
#define PS cout << ' '
#define INF (1LL << 60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N 100100

void solve()
{
  STR rd(s);
  LL n = s.size();
  if (n % 2 == 1)
  {
    No;
    return;
  }
  map<char, LL> mp;
  rep(i, n)
  {
    if (i % 2 == 0 && s[i] != s[i + 1])
    {
      No;
      return;
    }
    mp[s[i]]++;
  }
  repauto(x, mp)
  {
    if (x.second != 2)
    {
      No;
      return;
    }
  }

  Yes;
}

int main()
{
  LL T = 1;
  // LL rd(T);
  while (T--)
    solve();
  return 0;
}

Submission Info

Submission Time
Task B - 1122 String
User togi11
Language C++ 20 (gcc 12.2)
Score 150
Code Size 2632 Byte
Status AC
Exec Time 1 ms
Memory 3572 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 3
AC × 25
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3460 KB
example_01.txt AC 1 ms 3448 KB
example_02.txt AC 1 ms 3452 KB
hand_00.txt AC 1 ms 3504 KB
hand_01.txt AC 1 ms 3460 KB
hand_02.txt AC 1 ms 3572 KB
hand_03.txt AC 1 ms 3500 KB
hand_04.txt AC 1 ms 3464 KB
hand_05.txt AC 1 ms 3464 KB
hand_06.txt AC 1 ms 3560 KB
random_00.txt AC 1 ms 3568 KB
random_01.txt AC 1 ms 3444 KB
random_02.txt AC 1 ms 3464 KB
random_03.txt AC 1 ms 3524 KB
random_04.txt AC 1 ms 3564 KB
random_05.txt AC 1 ms 3468 KB
random_06.txt AC 1 ms 3524 KB
random_07.txt AC 1 ms 3568 KB
random_08.txt AC 1 ms 3456 KB
random_09.txt AC 1 ms 3448 KB
random_10.txt AC 1 ms 3492 KB
random_11.txt AC 1 ms 3436 KB
random_12.txt AC 1 ms 3528 KB
random_13.txt AC 1 ms 3436 KB
random_14.txt AC 1 ms 3376 KB


2025-03-05 (Wed)
20:49:38 +00:00