Task: | Babaza Game |
Sender: | user1111 |
Submission time: | 2024-09-02 17:49:22 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | WRONG ANSWER | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | WRONG ANSWER | 0.00 s | details |
#8 | WRONG ANSWER | 0.00 s | details |
#9 | WRONG ANSWER | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
Code
#include <bits/stdc++.h> using namespace std; bool babaza(string a) { for (unsigned i = 0; i < a.length()-1; i++) { if (a[i] == a[i+1]) return false; } return true; } int main() { string a,b; cin >> a >> b; string absdiff = a; string ldiff = a, rdiff = a; for (unsigned i = 0; i < a.length(); i++) { absdiff[i] = b[i] != a[i]; if (i%2) { ldiff[i] = b[i]; } else { rdiff[i] = b[i]; } } if (babaza(absdiff)) { cout << a << '\n'; cout << b << '\n'; return 0; } if (ldiff == b) { cout << a << '\n'; cout << ldiff << '\n'; cout << b << '\n'; return 0; } if (rdiff == b) { cout << a << '\n'; cout << rdiff << '\n'; cout << b << '\n'; return 0; } set<char> used = {}; for (unsigned i = 0; i < a.length(); i++) { used.insert(a[i]); used.insert(b[i]); } char unused = 'A'; for (;;unused++) { if (!(used.contains(unused))) { break; } } cout << a << '\n'; for (unsigned i = 0; i < a.length(); i++) { if (i%2) { ldiff[i] = unused; } } cout << ldiff << '\n'; for (unsigned i = 0; i < a.length(); i++) { if (!(i%2)) { ldiff[i] = b[i]; } } cout << ldiff << '\n'; cout << b << '\n'; return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
A B |
correct output |
---|
A B |
user output |
---|
A B |
Test 2
Verdict: WRONG ANSWER
input |
---|
BABAZA BACBCB |
correct output |
---|
BABAZA BACACA BACBCB |
user output |
---|
BABAZA BDBDZD BDCDCD BACBCB |
Test 3
Verdict: ACCEPTED
input |
---|
AB BA |
correct output |
---|
AB CB CA BA |
user output |
---|
AB AC BC BA |
Test 4
Verdict: ACCEPTED
input |
---|
ABC BCD |
correct output |
---|
ABC DBD DCD BCD |
user output |
---|
ABC AEC BED BCD |
Test 5
Verdict: WRONG ANSWER
input |
---|
AXYB CXYD |
correct output |
---|
AXYB CXYD |
user output |
---|
AXYB AEYE CEYE CXYD |
Test 6
Verdict: WRONG ANSWER
input |
---|
LMIJLF PAQBMH |
correct output |
---|
LMIJLF PMQJMF PAQBMH |
user output |
---|
LMIJLF LCICLC PCQCMC PAQBMH |
Test 7
Verdict: WRONG ANSWER
input |
---|
PNIWLSLIH CRLVPUFHD |
correct output |
---|
PNIWLSLIH CNLWPSFID CRLVPUFHD |
user output |
---|
PNIWLSLIH PAIALALAH CALAPAFAD CRLVPUFHD |
Test 8
Verdict: WRONG ANSWER
input |
---|
ZDYIAVTKL ZJKVXGAUM |
correct output |
---|
ZDYIAVTKL ZJYVAGTUL ZJKVXGAUM |
user output |
---|
ZDYIAVTKL ZBYBABTBL ZBKBXBABM ZJKVXGAUM |
Test 9
Verdict: WRONG ANSWER
input |
---|
FBIXISJH NXZIESMG |
correct output |
---|
FBIXISJH NBZXESMH NXZIESMG |
user output |
---|
FBIXISJH FAIAIAJA NAZAEAMA NXZIESMG |
Test 10
Verdict: WRONG ANSWER
input |
---|
OPGW QJIE |
correct output |
---|
OPGW QPIW QJIE |
user output |
---|
OPGW OAGA QAIA QJIE |
Test 11
Verdict: WRONG ANSWER
input |
---|
DUKNPKQZBL NZPBMOEBIC |
correct output |
---|
DUKNPKQZBL NUPNMKEZIL NZPBMOEBIC |
user output |
---|
DUKNPKQZBL DAKAPAQABA NAPAMAEAIA NZPBMOEBIC |
Test 12
Verdict: WRONG ANSWER
input |
---|
ZWDTX HZOXI |
correct output |
---|
ZWDTX HWOTI HZOXI |
user output |
---|
ZWDTX ZADAX HAOAI HZOXI |
Test 13
Verdict: WRONG ANSWER
input |
---|
URJF ITIQ |
correct output |
---|
URJF IRIF ITIQ |
user output |
---|
URJF UAJA IAIA ITIQ |
Test 14
Verdict: WRONG ANSWER
input |
---|
WYWBWU IRYVBA |
correct output |
---|
WYWBWU WRWVWA IRYVBA |
user output |
---|
WYWBWU WCWCWC ICYCBC IRYVBA |