Task: | Palindromi |
Sender: | maweiyin24562 |
Submission time: | 2024-01-20 13:16:47 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | WRONG ANSWER | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | WRONG ANSWER | 0.00 s | details |
#16 | WRONG ANSWER | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
Code
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; typedef long long ll; typedef long double ld; ll n,k; void solve(){ if(k%2==0){ for(ll i=1;i<=k/2;i++){ if(i%2==1)cout<<"d"; if(i%2==0)cout<<"e"; } for(ll i=1;i<=k/2;i++){ if(i%2==1)cout<<"e"; if(i%2==0)cout<<"d"; } } else if(k%2==1){ for(ll i=1;i<=k;i++){ if(i%2==1)cout<<"d"; if(i%2==0)cout<<"e"; } } } int main(){ cin>>n>>k; ll d=n-k; for(ll i=1;i<=d;i++){ if(i%3==1)cout<<"a"; if(i%3==2)cout<<"b"; if(i%3==0)cout<<"c"; } 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 |
---|
ad |
Test 3
Verdict: WRONG ANSWER
input |
---|
2 2 |
correct output |
---|
aa |
user output |
---|
de |
Test 4
Verdict: ACCEPTED
input |
---|
3 1 |
correct output |
---|
abc |
user output |
---|
abd |
Test 5
Verdict: WRONG ANSWER
input |
---|
3 2 |
correct output |
---|
aab |
user output |
---|
ade |
Test 6
Verdict: ACCEPTED
input |
---|
3 3 |
correct output |
---|
aaa |
user output |
---|
ded |
Test 7
Verdict: ACCEPTED
input |
---|
4 1 |
correct output |
---|
abca |
user output |
---|
abcd |
Test 8
Verdict: WRONG ANSWER
input |
---|
4 2 |
correct output |
---|
aabc |
user output |
---|
abde |
Test 9
Verdict: ACCEPTED
input |
---|
4 3 |
correct output |
---|
aaab |
user output |
---|
aded |
Test 10
Verdict: ACCEPTED
input |
---|
4 4 |
correct output |
---|
aaaa |
user output |
---|
deed |
Test 11
Verdict: ACCEPTED
input |
---|
100 1 |
correct output |
---|
abcabcabcabcabcabcabcabcabcabc... |
user output |
---|
abcabcabcabcabcabcabcabcabcabc... Truncated |
Test 12
Verdict: WRONG ANSWER
input |
---|
100 2 |
correct output |
---|
aabcabcabcabcabcabcabcabcabcab... |
user output |
---|
abcabcabcabcabcabcabcabcabcabc... Truncated |
Test 13
Verdict: ACCEPTED
input |
---|
100 5 |
correct output |
---|
aaaaabcabcabcabcabcabcabcabcab... |
user output |
---|
abcabcabcabcabcabcabcabcabcabc... Truncated |
Test 14
Verdict: WRONG ANSWER
input |
---|
100 10 |
correct output |
---|
aaaaaaaaaabcabcabcabcabcabcabc... |
user output |
---|
abcabcabcabcabcabcabcabcabcabc... Truncated |
Test 15
Verdict: WRONG ANSWER
input |
---|
100 50 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
abcabcabcabcabcabcabcabcabcabc... Truncated |
Test 16
Verdict: WRONG ANSWER
input |
---|
100 90 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
abcabcabcadededededededededede... Truncated |
Test 17
Verdict: ACCEPTED
input |
---|
100 100 |
correct output |
---|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... |
user output |
---|
dedededededededededededededede... Truncated |