Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dda2fa9

Browse files
Solve new problem on 23/09/2025
1 parent 227013c commit dda2fa9

File tree

4 files changed

+123
-0
lines changed

4 files changed

+123
-0
lines changed

‎A_Cards_for_Friends.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+
using namespace std;
3+
4+
int main()
5+
{
6+
int t;
7+
cin >> t;
8+
while (t--)
9+
{
10+
long long w, h, n;
11+
cin >> w >> h >> n;
12+
13+
long long pieces = 1;
14+
15+
while (w % 2 == 0)
16+
{
17+
w /= 2;
18+
pieces *= 2;
19+
}
20+
21+
while (h % 2 == 0)
22+
{
23+
h /= 2;
24+
pieces *= 2;
25+
}
26+
27+
if (pieces >= n)
28+
cout << "YES\n";
29+
else
30+
cout << "NO\n";
31+
}
32+
return 0;
33+
}

‎A_Draw_a_Square.cpp‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
ios::sync_with_stdio(false);
7+
cin.tie(nullptr);
8+
9+
int t;
10+
cin >> t;
11+
while (t--)
12+
{
13+
int l, r, d, u;
14+
cin >> l >> r >> d >> u;
15+
16+
if (l == r && d == u)
17+
cout << "Yes\n";
18+
else
19+
cout << "No\n";
20+
}
21+
return 0;
22+
}

‎A_Rook.cpp‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int t;
7+
if (!(cin >> t))
8+
return 0;
9+
while (t--)
10+
{
11+
string s;
12+
cin >> s;
13+
char col = s[0];
14+
char row = s[1];
15+
16+
for (char r = '1'; r <= '8'; ++r)
17+
{
18+
if (r == row)
19+
continue;
20+
cout << col << r << '\n';
21+
}
22+
for (char c = 'a'; c <= 'h'; ++c)
23+
{
24+
if (c == col)
25+
continue;
26+
cout << c << row << '\n';
27+
}
28+
}
29+
return 0;
30+
}

‎B_Upscaling.cpp‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int t;
7+
cin >> t;
8+
while (t--)
9+
{
10+
int n;
11+
cin >> n;
12+
13+
int size = 2 * n;
14+
15+
// Build the grid row by row
16+
for (int i = 0; i < n; i++)
17+
{ // block row
18+
string row1 = "", row2 = "";
19+
for (int j = 0; j < n; j++)
20+
{ // block column
21+
if ((i + j) % 2 == 0)
22+
{
23+
row1 += "##";
24+
row2 += "##";
25+
}
26+
else
27+
{
28+
row1 += "..";
29+
row2 += "..";
30+
}
31+
}
32+
cout << row1 << "\n"
33+
<< row2 << "\n";
34+
}
35+
}
36+
37+
return 0;
38+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /