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 0128fa0

Browse files
Solve new problem on 18/09/2025
1 parent cf8eadb commit 0128fa0

File tree

4 files changed

+108
-0
lines changed

4 files changed

+108
-0
lines changed

‎A._Musical_Puzzle.cpp‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
int main()
4+
{
5+
int t;
6+
cin >> t;
7+
while (t--)
8+
{
9+
int n;
10+
cin >> n;
11+
string s;
12+
cin >> s;
13+
set<string> st;
14+
for (int i = 0; i < n - 1; i++)
15+
{
16+
string temp = "";
17+
temp += s[i];
18+
temp += s[i + 1];
19+
st.insert(temp);
20+
}
21+
cout << st.size() << endl;
22+
}
23+
return 0;
24+
}

‎A_Problemsolving_Log.cpp‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
string s;
13+
cin >> s;
14+
set<char> solved;
15+
int time_spent = 0;
16+
for (char c : s)
17+
{
18+
int problem_time = c - 'A' + 1;
19+
time_spent++;
20+
if (time_spent >= problem_time)
21+
{
22+
solved.insert(c);
23+
}
24+
}
25+
cout << solved.size() << endl;
26+
}
27+
return 0;
28+
}

‎A_Repeating_Cipher.cpp‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int n;
7+
cin >> n;
8+
string t;
9+
cin >> t;
10+
string s = "";
11+
int i = 0;
12+
while (i < n)
13+
{
14+
char c = t[i];
15+
s += c;
16+
i += s.length();
17+
}
18+
cout << s << endl;
19+
return 0;
20+
}

‎A_Rudolph_and_Cut_the_Rope.cpp‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
vector<pair<int, int>> v(n);
13+
for (int i = 0; i < n; i++)
14+
{
15+
cin >> v[i].first >> v[i].second;
16+
}
17+
18+
// sort by nail height (a[i])
19+
sort(v.begin(), v.end());
20+
21+
int ans = n; // worst case cut all
22+
for (int i = 0; i < n; i++)
23+
{
24+
int a = v[i].first, b = v[i].second;
25+
26+
// If this rope can reach ground
27+
if (a - b <= 0)
28+
{
29+
// Ropes below this need to be cut (i ropes)
30+
ans = min(ans, i);
31+
}
32+
}
33+
cout << ans << "\n";
34+
}
35+
return 0;
36+
}

0 commit comments

Comments
(0)

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