Task: | Pinta-ala |
Sender: | cppbetter |
Submission time: | 2023-01-21 14:17:31 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | details |
#2 | WRONG ANSWER | 0.00 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
Code
// a+1 b+1 = a+b = B- 1 - A #include <iostream> #include <vector> #include <tuple> #include <cmath> bool crosses(double c, double a) { // (a+1) (b+1) = B // ab+a+b+1 = B // a+b= B-A-1 // A/b=B- A- 1-b // A=-b^2+(B- A- 1)b // 0=-b^2+(B- A- 1)b-A // b = (-c+-sqrt(c^2-4*(-1)*(-A))))/(2*1) double delta = c*c-4*(-1)*(-a); return delta >= 0; } 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; yesNo.push_back(crosses(b - a - 1, a)); } for(auto a : yesNo) { if(a) std::cout << "YES\n"; else std::cout << "NO\n"; } }
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 |
---|
YES YES YES YES YES ... 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 |
---|
YES YES YES YES YES ... 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 YES YES ... Truncated |