全部评论 2

  • 你写了啥代码,让我看一下(其实看压缩完是否有相邻的字母就行了,数值不重要)。

    2025-08-23 来自 广东

    0
    • #include<bits/stdc++.h>
      using namespace std;
      int main(){
          int n;
          cin >> n;
          map<string,bool> m;
          while(n--){
              string a;
              int b;
              cin >> a >> b;
              if(m[a] == true){
                  cout << "No";
                  return 0;
              } else {
                  m[a] = true;
              }
          }
          cout << "Yes";
          return 0;
      }
      

      2025-08-24 来自 浙江

      0
    • userId_undefined

      entj

      回复entj

      AC代码

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
          int n;
          cin >> n;
          string p;
          while(n--){
              string a;
              int b;
              cin >> a >> b;
              if(p == a){
                  cout << "No";
                  return 0;
              } else {
                  p = a;
              }
          }
          cout << "Yes";
          return 0;
      }
      

      2025-08-24 来自 浙江

      0
  • 我一样

    2025-08-22 来自 湖南

    0

热门讨论