| Task: | Spin-Pop-Squeeze-Clap |
| Sender: | aalto26cw_003 |
| Submission time: | 2026-09-16 17:51:23 +0300 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | WRONG ANSWER |
| 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 | WRONG ANSWER | 0.00 s | details |
| #6 | WRONG ANSWER | 0.04 s | details |
| #7 | WRONG ANSWER | 0.01 s | details |
| #8 | WRONG ANSWER | 0.03 s | details |
| #9 | WRONG ANSWER | 0.01 s | details |
| #10 | WRONG ANSWER | 0.00 s | details |
| #11 | WRONG ANSWER | 0.01 s | details |
| #12 | WRONG ANSWER | 0.01 s | details |
| #13 | WRONG ANSWER | 0.02 s | details |
| #14 | WRONG ANSWER | 0.01 s | details |
| #15 | WRONG ANSWER | 0.01 s | details |
| #16 | WRONG ANSWER | 0.02 s | details |
| #17 | WRONG ANSWER | 0.01 s | details |
| #18 | WRONG ANSWER | 0.01 s | details |
| #19 | WRONG ANSWER | 0.01 s | details |
| #20 | WRONG ANSWER | 0.00 s | details |
| #21 | WRONG ANSWER | 0.01 s | details |
| #22 | WRONG ANSWER | 0.02 s | details |
| #23 | WRONG ANSWER | 0.02 s | details |
| #24 | WRONG ANSWER | 0.01 s | details |
| #25 | WRONG ANSWER | 0.03 s | details |
| #26 | WRONG ANSWER | 0.03 s | details |
| #27 | WRONG ANSWER | 0.01 s | details |
| #28 | WRONG ANSWER | 0.05 s | details |
| #29 | WRONG ANSWER | 0.05 s | details |
| #30 | WRONG ANSWER | 0.03 s | details |
| #31 | WRONG ANSWER | 0.02 s | details |
| #32 | WRONG ANSWER | 0.02 s | details |
| #33 | WRONG ANSWER | 0.03 s | details |
| #34 | WRONG ANSWER | 0.01 s | details |
| #35 | WRONG ANSWER | 0.02 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:45:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
45 | for (int j = 0; j < A.size(); ++j) {
| ~~^~~~~~~~~~
input/code.cpp: In instantiation of 'uint64_t distance(auto:18, auto:19) [with auto:18 = std::vector<unsigned int>; auto:19 = std::vector<unsigned int>; uint64_t = long unsigned int]':
input/code.cpp:44:32: required from here
input/code.cpp:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<unsigned int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | for (int a = 1; a <= A.size(); ++a) {
| ~~^~~~~~~~~~~
input/code.cpp:15:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<unsigned int>::size_type' {aka 'long unsigned int'} [-Ws...Code
#include <iostream>
#include <vector>
#include <cstdint>
#include <numeric>
uint64_t add_one_if_unequal(auto &iter1, auto &iter2) {
if (*iter1 == iter2) return 0;
return 1;
}
uint64_t distance(auto A, auto B) {
std::vector<std::vector<int>> distances(A.size()+1, std::vector<int>(B.size()+1));
distances[0][0] = 0;
for (int a = 1; a <= A.size(); ++a) {
for (int b = 1; b <= B.size(); ++b) {
//if (a == 0 && b == 0) continue;
distances[a][b] = INT32_MAX;
if (b != 0) distances[a][b] = std::min(distances[a][b], distances[a][b-1]+1);
if (a != 0) distances[a][b] = std::min(distances[a][b], distances[a-1][b]+1);
if (a != 0 && b != 0) {
int cost = A[a] != B[b];
distances[a][b] = std::min(distances[a][b], distances[a-1][b-1] + cost);
}
}
}
return distances[A.size()][B.size()];
}
int main() {
std::string A, B;
std::cin >> A >> B;
std::vector<uint> A_vec, B_vec;
for (char a : A) {
A_vec.push_back(a-'0');
}
for (char b : B) {
B_vec.push_back(b-'0');
}
uint64_t min = UINT64_MAX;
for (int i = 0; i < 10; ++i) {
min = std::min(distance(A_vec, B_vec)+i, min);
for (int j = 0; j < A.size(); ++j) {
A_vec[j] = (A_vec[j] + 1) % 10;
}
}
std::cout << min;
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 111222 283303 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 4 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 123123 54545 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 4 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 111 222 |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 999 999 |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 450 57 |
| correct output |
|---|
| 2 |
| user output |
|---|
| 1 |
Feedback: Incorrect character on line 1 col 1: expected "2", got "1"
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 660487647593824219489241157815... |
| correct output |
|---|
| 674 |
| user output |
|---|
| 589 |
Feedback: Incorrect character on line 1 col 1: expected "674", got "589"
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 914177763170669074391500080636... |
| correct output |
|---|
| 130 |
| user output |
|---|
| 94 |
Feedback: Incorrect character on line 1 col 1: expected "130", got "94"
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 011524493909266858784005756682... |
| correct output |
|---|
| 681 |
| user output |
|---|
| 383 |
Feedback: Incorrect character on line 1 col 1: expected "681", got "383"
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 982597919074833788762328601290... |
| correct output |
|---|
| 717 |
| user output |
|---|
| 165 |
Feedback: Incorrect character on line 1 col 1: expected "717", got "165"
Test 10
Verdict: WRONG ANSWER
| input |
|---|
| 416721106840388542143044324451... |
| correct output |
|---|
| 215 |
| user output |
|---|
| 20 |
Feedback: Incorrect character on line 1 col 2: expected "215", got "20"
Test 11
Verdict: WRONG ANSWER
| input |
|---|
| 458073021573681930364262129972... |
| correct output |
|---|
| 473 |
| user output |
|---|
| 168 |
Feedback: Incorrect character on line 1 col 1: expected "473", got "168"
Test 12
Verdict: WRONG ANSWER
| input |
|---|
| 917400297550473688139849165156... |
| correct output |
|---|
| 699 |
| user output |
|---|
| 85 |
Feedback: Incorrect character on line 1 col 1: expected "699", got "85"
Test 13
Verdict: WRONG ANSWER
| input |
|---|
| 260181590830166131860913909960... |
| correct output |
|---|
| 584 |
| user output |
|---|
| 228 |
Feedback: Incorrect character on line 1 col 1: expected "584", got "228"
Test 14
Verdict: WRONG ANSWER
| input |
|---|
| 562301238360777679361730486761... |
| correct output |
|---|
| 284 |
| user output |
|---|
| 160 |
Feedback: Incorrect character on line 1 col 1: expected "284", got "160"
Test 15
Verdict: WRONG ANSWER
| input |
|---|
| 954220587915890627622301289161... |
| correct output |
|---|
| 416 |
| user output |
|---|
| 42 |
Feedback: Incorrect character on line 1 col 2: expected "416", got "42"
Test 16
Verdict: WRONG ANSWER
| input |
|---|
| 067903774208751350629566447245... |
| correct output |
|---|
| 442 |
| user output |
|---|
| 395 |
Feedback: Incorrect character on line 1 col 1: expected "442", got "395"
Test 17
Verdict: WRONG ANSWER
| input |
|---|
| 877893287921742180967929081003... |
| correct output |
|---|
| 358 |
| user output |
|---|
| 314 |
Feedback: Incorrect character on line 1 col 2: expected "358", got "314"
Test 18
Verdict: WRONG ANSWER
| input |
|---|
| 485260574793809275253093185610... |
| correct output |
|---|
| 442 |
| user output |
|---|
| 32 |
Feedback: Incorrect character on line 1 col 1: expected "442", got "32"
Test 19
Verdict: WRONG ANSWER
| input |
|---|
| 423232218340629042147624537896... |
| correct output |
|---|
| 192 |
| user output |
|---|
| 77 |
Feedback: Incorrect character on line 1 col 1: expected "192", got "77"
Test 20
Verdict: WRONG ANSWER
| input |
|---|
| 983444174766143554582284201195... |
| correct output |
|---|
| 83 |
| user output |
|---|
| 33 |
Feedback: Incorrect character on line 1 col 1: expected "83", got "33"
Test 21
Verdict: WRONG ANSWER
| input |
|---|
| 308023002531575464533553486397... |
| correct output |
|---|
| 984 |
| user output |
|---|
| 3 |
Feedback: Incorrect character on line 1 col 1: expected "984", got "3"
Test 22
Verdict: WRONG ANSWER
| input |
|---|
| 774637064330445294039402907794... |
| correct output |
|---|
| 544 |
| user output |
|---|
| 257 |
Feedback: Incorrect character on line 1 col 1: expected "544", got "257"
Test 23
Verdict: WRONG ANSWER
| input |
|---|
| 645428410366485628023288358114... |
| correct output |
|---|
| 378 |
| user output |
|---|
| 326 |
Feedback: Incorrect character on line 1 col 2: expected "378", got "326"
Test 24
Verdict: WRONG ANSWER
| input |
|---|
| 175337727474341582323359837344... |
| correct output |
|---|
| 695 |
| user output |
|---|
| 129 |
Feedback: Incorrect character on line 1 col 1: expected "695", got "129"
Test 25
Verdict: WRONG ANSWER
| input |
|---|
| 081836584929414654154099313187... |
| correct output |
|---|
| 493 |
| user output |
|---|
| 431 |
Feedback: Incorrect character on line 1 col 2: expected "493", got "431"
Test 26
Verdict: WRONG ANSWER
| input |
|---|
| 241592066112579763355561876139... |
| correct output |
|---|
| 630 |
| user output |
|---|
| 442 |
Feedback: Incorrect character on line 1 col 1: expected "630", got "442"
Test 27
Verdict: WRONG ANSWER
| input |
|---|
| 664737828830059612330669705871... |
| correct output |
|---|
| 559 |
| user output |
|---|
| 111 |
Feedback: Incorrect character on line 1 col 1: expected "559", got "111"
Test 28
Verdict: WRONG ANSWER
| input |
|---|
| 230972151340592860909446321989... |
| correct output |
|---|
| 696 |
| user output |
|---|
| 589 |
Feedback: Incorrect character on line 1 col 1: expected "696", got "589"
Test 29
Verdict: WRONG ANSWER
| input |
|---|
| 410946685234703970117608650309... |
| correct output |
|---|
| 691 |
| user output |
|---|
| 609 |
Feedback: Incorrect character on line 1 col 2: expected "691", got "609"
Test 30
Verdict: WRONG ANSWER
| input |
|---|
| 692323212407710827747149254185... |
| correct output |
|---|
| 536 |
| user output |
|---|
| 478 |
Feedback: Incorrect character on line 1 col 1: expected "536", got "478"
Test 31
Verdict: WRONG ANSWER
| input |
|---|
| 034704049619193895285878119956... |
| correct output |
|---|
| 467 |
| user output |
|---|
| 264 |
Feedback: Incorrect character on line 1 col 1: expected "467", got "264"
Test 32
Verdict: WRONG ANSWER
| input |
|---|
| 336980270982636303223976539004... |
| correct output |
|---|
| 543 |
| user output |
|---|
| 283 |
Feedback: Incorrect character on line 1 col 1: expected "543", got "283"
Test 33
Verdict: WRONG ANSWER
| input |
|---|
| 744311485456233719196607507429... |
| correct output |
|---|
| 570 |
| user output |
|---|
| 453 |
Feedback: Incorrect character on line 1 col 1: expected "570", got "453"
Test 34
Verdict: WRONG ANSWER
| input |
|---|
| 289232763326229330631165228849... |
| correct output |
|---|
| 563 |
| user output |
|---|
| 81 |
Feedback: Incorrect character on line 1 col 1: expected "563", got "81"
Test 35
Verdict: WRONG ANSWER
| input |
|---|
| 159941856600173517598637236698... |
| correct output |
|---|
| 431 |
| user output |
|---|
| 382 |
Feedback: Incorrect character on line 1 col 1: expected "431", got "382"
