Skip to content

Commit 7e39ed1

Browse files
committed
Codeforces round 682 Div 2
1 parent 08b8f22 commit 7e39ed1

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

Codeforces/1438A.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <bits/stdc++.h>
2+
3+
#define MX 1e4+5
4+
5+
using namespace std;
6+
7+
typedef pair<int, int> pii;
8+
typedef vector<int> vi;
9+
typedef vector<pii> vii;
10+
11+
12+
void test_case() {
13+
14+
int n;
15+
cin >> n;
16+
for(int i = 0; i < n; i++)
17+
cout << "1 ";
18+
cout << endl;
19+
20+
}
21+
22+
23+
int main() {
24+
25+
int T;
26+
cin >> T;
27+
28+
while(T--) {
29+
test_case();
30+
}
31+
32+
return 0;
33+
}

Codeforces/1438B.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include <bits/stdc++.h>
2+
3+
#define MX 1e4+5
4+
5+
using namespace std;
6+
7+
typedef pair<int, int> pii;
8+
typedef vector<int> vi;
9+
typedef vector<pii> vii;
10+
11+
12+
void solve() {
13+
//
14+
int n;
15+
cin >> n;
16+
17+
vi a(n);
18+
for(int i = 0; i < n; i++)
19+
cin >> a[i];
20+
21+
sort(a.begin(), a.end());
22+
for(int i = 0; i < n-1; i++)
23+
if(a[i] == a[i+1]) {
24+
cout << "YES\n";
25+
return;
26+
}
27+
cout << "NO\n";
28+
}
29+
30+
31+
int main() {
32+
33+
int T;
34+
cin >> T;
35+
while(T--)
36+
solve();
37+
38+
return 0;
39+
}

0 commit comments

Comments
 (0)