File tree Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments