Task: | Pinta-ala |
Sender: | cppbetter |
Submission time: | 2023-01-21 13:56:33 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
Code
// a+1 b+1 = A/b + b = B- 1 - A #include <iostream> #include <vector> #include <tuple> #include <cmath> int main() { int t; std::cin >> t; std::vector<bool> yesNo; for(int i = 0; i < t; i++) { int a, b; std::cin >> a >> b; bool yes = false; // Find all possible multiples and check: for(int j = 1; j < std::ceil(std::sqrt(a)); j++) { if(a % j == 0) if( (a / j + 1) * (j + 1) == b - 1) { yes = true; break; } } yesNo.push_back(yes); } for(auto a : yesNo) { if(a) std::cout << "YES\n"; else std::cout << "NO\n"; } // Flawed test... }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1000 578049 731905 262997 434601 559974 650052 458543 101143 ... |
correct output |
---|
YES YES YES NO NO ... |
user output |
---|
NO NO NO NO NO ... Truncated |
Test 2
Verdict: WRONG ANSWER
input |
---|
1000 10000 9500 10000 9501 10000 9502 10000 9503 ... |
correct output |
---|
NO NO NO NO NO ... |
user output |
---|
NO NO NO NO NO ... Truncated |
Test 3
Verdict: WRONG ANSWER
input |
---|
961 1 1 1 2 1 3 1 4 ... |
correct output |
---|
NO NO NO YES YES ... |
user output |
---|
NO NO NO NO NO ... Truncated |