Skip to content

Commit c14f745

Browse files
committed
done
1 parent c32fe55 commit c14f745

File tree

6 files changed

+20
-67
lines changed

6 files changed

+20
-67
lines changed

CF1.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ GitHub: https://github.com/Hard-Coder05
66
#############################################
77
*/
88
#include <bits/stdc++.h>
9-
109
#define endl "\n"
1110
#define max(a, b) (a < b ? b : a)
1211
#define min(a, b) ((a > b) ? b : a)
@@ -29,35 +28,5 @@ int main()
2928
cin >> tc;
3029
while (tc--)
3130
{
32-
ll n, x;
33-
cin >> n >> x;
34-
ll arr[n];
35-
ll sum = 0;
36-
for (ll i = 0; i < n; i++)
37-
{
38-
cin >> arr[i];
39-
sum += arr[i];
40-
}
41-
if (sum == x)
42-
cout << "NO" << endl;
43-
else
44-
{
45-
cout << "YES" << endl;
46-
ll currsum = 0;
47-
for (ll i = 0; i < n; i++)
48-
{
49-
currsum += arr[i];
50-
if (currsum == x)
51-
{
52-
cout << arr[i + 1] << " " << arr[i] << " ";
53-
i++;
54-
}
55-
else
56-
{
57-
cout << arr[i] << " ";
58-
}
59-
}
60-
cout << endl;
61-
}
6231
}
6332
}

CF2.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ GitHub: https://github.com/Hard-Coder05
1717
cout.tie(NULL);
1818
using namespace std;
1919
typedef long long ll;
20-
bool isPerfectSquare(long double x)
21-
{
22-
if (x >= 0)
23-
{
24-
long long sr = sqrt(x);
25-
return (sr * sr == x);
26-
}
27-
return false;
28-
}
2920
int main()
3021
{
3122
FIO;
@@ -37,11 +28,5 @@ int main()
3728
cin >> tc;
3829
while (tc--)
3930
{
40-
long double n;
41-
cin >> n;
42-
if (isPerfectSquare(n / 2) || isPerfectSquare(n / 4))
43-
cout << "YES" << endl;
44-
else
45-
cout << "NO" << endl;
4631
}
4732
}

CF5.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,26 @@ GitHub: https://github.com/Hard-Coder05
77
*/
88
#include <bits/stdc++.h>
99
#define endl "\n"
10-
#define max(a, b) (a < b ? b : a)
11-
#define min(a, b) ((a > b) ? b : a)
10+
#define max(a, b) (a < b ? b : a)
11+
#define min(a, b) ((a > b) ? b : a)
1212
#define MOD 1000000007
1313
#define INF 1000000000000000003
14-
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
14+
#define FIO \
15+
ios_base::sync_with_stdio(false); \
16+
cin.tie(NULL); \
17+
cout.tie(NULL);
1518
using namespace std;
1619
typedef long long ll;
17-
int main() {
20+
int main()
21+
{
1822
FIO;
1923
#ifndef ONLINE_JUDGE
2024
freopen("input.txt", "r", stdin);
2125
freopen("output.txt", "w", stdout);
2226
#endif
2327
ll tc;
2428
cin >> tc;
25-
while (tc--) {
26-
29+
while (tc--)
30+
{
2731
}
2832
}

CF6.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,26 @@ GitHub: https://github.com/Hard-Coder05
77
*/
88
#include <bits/stdc++.h>
99
#define endl "\n"
10-
#define max(a, b) (a < b ? b : a)
11-
#define min(a, b) ((a > b) ? b : a)
10+
#define max(a, b) (a < b ? b : a)
11+
#define min(a, b) ((a > b) ? b : a)
1212
#define MOD 1000000007
1313
#define INF 1000000000000000003
14-
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
14+
#define FIO \
15+
ios_base::sync_with_stdio(false); \
16+
cin.tie(NULL); \
17+
cout.tie(NULL);
1518
using namespace std;
1619
typedef long long ll;
17-
int main() {
20+
int main()
21+
{
1822
FIO;
1923
#ifndef ONLINE_JUDGE
2024
freopen("input.txt", "r", stdin);
2125
freopen("output.txt", "w", stdout);
2226
#endif
2327
ll tc;
2428
cin >> tc;
25-
while (tc--) {
26-
29+
while (tc--)
30+
{
2731
}
2832
}

input.txt

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

output.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
YES
2-
YES
3-
NO
4-
NO

0 commit comments

Comments
 (0)