2 条题解

  • 0
    @ 2026-5-17 14:41:12
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        int n;
        cin >> n;
        int a[n];
        for(int i = 0; i < n; i++) cin >> a[i];
        for(int i = 0; i < n - 1; i++){
            if(a[i] != a[i+1]) {
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes";
        return 0;
    }
    • 0
      @ 2026-2-27 15:56:29
      #include<bits/stdc++.h>
      using namespace std;
      #define int long long
      signed main()
      {
      	int n;cin>>n;
      	int x;cin>>x;
      	for(int i=2;i<=n;i++)
      	{
      		int y;cin>>y;
      		if(y!=x){cout<<"No";return 0;}
      	}
      	cout<<"Yes";
      	return 0;
      }
      • 1

      信息

      ID
      8801
      时间
      2000ms
      内存
      1024MiB
      难度
      4
      标签
      递交数
      59
      已通过
      27
      上传者