Task: | Palindromi |
Sender: | vgtcross |
Submission time: | 2024-01-20 13:14:09 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
Compiler report
input/code.cpp: In function 'void solve()': input/code.cpp:17:23: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare] 17 | while (ans.size() < k) ans += pal; | ~~~~~~~~~~~^~~ input/code.cpp:18:23: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare] 18 | while (ans.size() < n) ans += dump; | ~~~~~~~~~~~^~~
Code
#include <bits/stdc++.h> #define fi first #define se second using namespace std; using ll = long long; using pic = pair<int, char>; void solve() { int n, k; cin >> n >> k; string dump = "abc"; string pal = "d"; string ans; while (ans.size() < k) ans += pal; while (ans.size() < n) ans += dump; ans.resize(n); cout << ans << '\n'; } int main() { cin.tie(0) -> sync_with_stdio(0); solve(); return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1 1 |
correct output |
---|
a |
user output |
---|
d |
Test 2
Verdict: ACCEPTED
input |
---|
2 1 |
correct output |
---|
ab |
user output |
---|
da |
Test 3
Verdict: ACCEPTED
input |
---|
2 2 |
correct output |
---|
aa |
user output |
---|
dd |
Test 4
Verdict: ACCEPTED
input |
---|
3 1 |
correct output |
---|
abc |
user output |
---|
dab |
Test 5
Verdict: ACCEPTED
input |
---|
3 2 |
correct output |
---|
aab |
user output |
---|
dda |
Test 6
Verdict: ACCEPTED
input |
---|
3 3 |
correct output |
---|
aaa |
user output |
---|
ddd |
Test 7
Verdict: ACCEPTED
input |
---|
4 1 |
correct output |
---|
abca |
user output |
---|
dabc |
Test 8
Verdict: ACCEPTED
input |
---|
4 2 |
correct output |
---|
aabc |
user output |
---|
ddab |
Test 9
Verdict: ACCEPTED
input |
---|
4 3 |
correct output |
---|
aaab |
user output |
---|
ddda |
Test 10
Verdict: ACCEPTED
input |
---|
4 4 |
correct output |
---|
aaaa |
user output |
---|
dddd |
Test 11
Verdict: ACCEPTED
input |
---|
100 1 |
correct output |
---|
abcabcabcabcabcabcabcabcabcabc... |
user output |
---|
dabcabcabcabcabcabcabcabcabcab... Truncated |
Test 12
Verdict: ACCEPTED
input |
---|
100 2 |
correct output |
---|
aabcabcabcabcabcabcabcabcabcab... |
user output |
---|
ddabcabcabcabcabcabcabcabcabca... Truncated |
Test 13
Verdict: ACCEPTED
input |
---|
100 5 |
correct output |
---|
aaaaabcabcabcabcabcabcabcabcab... |
user output |
---|
dddddabcabcabcabcabcabcabcabca... Truncated |
Test 14
Verdict: ACCEPTED
input |
---|
100 10 |
correct output |
---|
aaaaaaaaaabcabcabcabcabcabcabc... |
user output |
---|
ddddddddddabcabcabcabcabcabcab... Truncated |
Test 15
Verdict: ACCEPTED
input |
---|
100 50 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
dddddddddddddddddddddddddddddd... Truncated |
Test 16
Verdict: ACCEPTED
input |
---|
100 90 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
dddddddddddddddddddddddddddddd... Truncated |
Test 17
Verdict: ACCEPTED
input |
---|
100 100 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
dddddddddddddddddddddddddddddd... Truncated |