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 69282f8

Browse files
committed
Today ps
1 parent 550bfda commit 69282f8

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

‎Baekjoon/Cpp/1213.cpp‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
int arr[26];
6+
7+
int main()
8+
{
9+
ios::sync_with_stdio(false);
10+
cout.tie(nullptr);
11+
cin.tie(nullptr);
12+
string s, ans;
13+
char c;
14+
int d, i, mid = -1, res = 0;
15+
set<int> als;
16+
cin >> s;
17+
for (auto c : s)
18+
{
19+
d = int(c) - 65;
20+
arr[d] += 1;
21+
als.insert(d);
22+
}
23+
for (auto d : als)
24+
{
25+
res += arr[d] % 2;
26+
if (arr[d] % 2 == 1)
27+
{
28+
mid = d;
29+
}
30+
for (i = 0; i < arr[d] / 2; i++)
31+
{
32+
ans += char(d + 65);
33+
}
34+
}
35+
if (res > 1)
36+
{
37+
cout << "I'm Sorry Hansoo";
38+
}
39+
else
40+
{
41+
cout << ans;
42+
reverse(ans.begin(), ans.end());
43+
if (mid != -1)
44+
{
45+
cout << char(mid + 65);
46+
}
47+
cout << ans;
48+
}
49+
return 0;
50+
}

‎Baekjoon/Cpp/2864.cpp‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using pii = pair<int, int>;
5+
6+
const int unit[7] = {1000000, 100000, 10000, 1000, 100, 10, 1};
7+
8+
pii solve(string &s)
9+
{
10+
pii res;
11+
int i, d, len = s.size();
12+
for (i = 0; i < len; i++)
13+
{
14+
d = s[i] - '0';
15+
res.second += (d == 5 ? 6 : d) * unit[i + 7 - len];
16+
res.first += (d == 6 ? 5 : d) * unit[i + 7 - len];
17+
}
18+
return res;
19+
}
20+
21+
int main()
22+
{
23+
ios::sync_with_stdio(false);
24+
cin.tie(nullptr);
25+
cout.tie(nullptr);
26+
string a, b;
27+
cin >> a >> b;
28+
pii ans_a = solve(a), ans_b = solve(b);
29+
cout << ans_a.first + ans_b.first << " " << ans_a.second + ans_b.second;
30+
return 0;
31+
}

‎Baekjoon/Cpp/4796.cpp‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
int main()
6+
{
7+
ios::sync_with_stdio(false);
8+
cout.tie(nullptr);
9+
cin.tie(nullptr);
10+
int l, p, v, i = 0;
11+
cin >> l >> p >> v;
12+
while (l != 0 || p != 0 || v != 0)
13+
{
14+
i += 1;
15+
cout << "Case " << i << ": " << (v / p) * l + min(v % p, l) << "\n";
16+
cin >> l >> p >> v;
17+
}
18+
return 0;
19+
}

0 commit comments

Comments
(0)

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