CF2133A Redstone?题解
S1lver_W0lf · · 题解
CF2133A Redstone?题解
分析
查看样例,注意到:有相同数值的组输出 YES,否则输出 NO。
证明
形式化题意:给出
我们展开一下:
最后得出结论:
所以只要给出的
代码
#include <bits/stdc++.h>
using namespace std;
int T;
void solve(){
int n;
cin >> n;
vector <int> a(110, 0);
bool f = 0;
for(int i = 1, x; i <= n; i++){
cin >> x;
a[x]++;
if(a[x] == 2)
f = 1;
}
if(f)
cout << "Yes\n";
else
cout << "No\n";
}
int main(){
cin >> T;
while(T--){
solve();
}
return 0;
}