Skip to content

Commit cca9728

Browse files
committed
done
1 parent d453a02 commit cca9728

File tree

5 files changed

+19
-50
lines changed

5 files changed

+19
-50
lines changed

CF1.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ int main() {
2323
ll tc;
2424
cin >> tc;
2525
while (tc--) {
26-
ll n;cin>>n;
27-
ll eve=0,odd=0;
28-
for(ll i=0;i<n;i++){
29-
ll x;
30-
cin>>x;
31-
if(x&1)
32-
odd++;
33-
else
34-
eve++;
26+
ll n,x;
27+
cin>>n>>x;
28+
bool ans=false;
29+
for(ll i=1;i<=n;i++){
30+
ll a=x/i;
31+
if(i*a==x&&a<n){
32+
ans=true;
33+
break;
34+
}
3535
}
36-
cout<<min(odd,eve)<<endl;
36+
if(ans)
37+
cout<<"YES"<<endl;
38+
else
39+
cout<<"NO"<<endl;
3740
}
3841
}

CF1.exe

-259 Bytes
Binary file not shown.

CF3.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,6 @@
11
#include <bits/stdc++.h>
22
using namespace std;
33

4-
int ceilIndex(int tail[], int l, int r, int x) {
5-
while(l < r) {
6-
int mid = l + (r-l)/2;
7-
8-
if(tail[mid] >= x) {
9-
r = mid;
10-
} else {
11-
l = mid+1;
12-
}
13-
}
14-
15-
return r;
16-
}
17-
18-
int LIS(vector<int> arr, int n) {
19-
int tail[n];
20-
21-
tail[0] = arr[0];
22-
int len = 1;
23-
24-
for(int i = 1; i < n; i++) {
25-
if(arr[i] > tail[len-1]) {
26-
tail[len] = arr[i];
27-
len++;
28-
} else {
29-
int c = ceilIndex(tail, 0, len-1, arr[i]);
30-
tail[c] = arr[i];
31-
}
32-
}
33-
34-
return len;
35-
}
36-
374
int main()
385
{
396
#ifndef ONLINE_JUDGE

input.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
3
21
2
3-
1 2
4-
3
5-
1 1 2
6-
3
7-
1 2 4
2+
3 2
3+
3 4 3
4+
5 6
5+
6 6 8 7 3

output.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
17
1+
YES
2+
NO

0 commit comments

Comments
 (0)