QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#60971 | #3525. Move & Meet | abdelrahman001# | WA | 3ms | 3420kb | C++20 | 729b | 2022-11-08 23:25:11 | 2022-11-08 23:25:13 |
Judging History
answer
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e5 + 5;
ll x, y, d1, a, b, d2;
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> x >> y >> d1 >> a >> b >> d2;
if(abs(x - a) + abs(y - b) > d1 + d2)
return cout << "impossible", 0;
if(((x + y + d1) & 1) != ((a + b + d2) & 1))
return cout << "impossible", 0;
if(x < a) {
d2 -= a - x;
} else {
d2 -= x - a;
}
if(y < b) {
b -= d2;
} else {
b += d2;
}
cout << x << " " << b;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3308kb
input:
-1 -2 0 1 2 6
output:
-1 -2
result:
ok
Test #2:
score: 0
Accepted
time: 2ms
memory: 3304kb
input:
1 -2 5 -3 3 8
output:
1 -1
result:
ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3420kb
input:
0 -1000000000000 0 0 -1000000000000 0
output:
0 -1000000000000
result:
ok
Test #4:
score: 0
Accepted
time: 2ms
memory: 3332kb
input:
-5 -426 932111 83 -870 478692
output:
impossible
result:
ok
Test #5:
score: 0
Accepted
time: 1ms
memory: 3304kb
input:
4 5 6 4 -2 1
output:
4 -1
result:
ok
Test #6:
score: 0
Accepted
time: 2ms
memory: 3240kb
input:
0 0 2 2 2 2
output:
0 2
result:
ok
Test #7:
score: 0
Accepted
time: 2ms
memory: 3392kb
input:
0 0 1000000000000 5 19923 186
output:
0 19742
result:
ok
Test #8:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
-237700907237 445576550446 594610055595 681973265681 -171560526172 843757392844
output:
impossible
result:
ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3364kb
input:
-537351556538 -807721987807 690465417691 287415372288 977794499977 17905823179
output:
impossible
result:
ok
Test #10:
score: 0
Accepted
time: 2ms
memory: 3240kb
input:
30 40 100000 -120 1 100
output:
impossible
result:
ok
Test #11:
score: 0
Accepted
time: 3ms
memory: 3392kb
input:
267127854709 343405973674 26161892148 381294549365 370274347369 145141827064
output:
impossible
result:
ok
Test #12:
score: 0
Accepted
time: 2ms
memory: 3304kb
input:
-31878165543 682414817093 568347503685 70100797810 257224740065 112811330402
output:
-31878165543 268057107114
result:
ok
Test #13:
score: -100
Wrong Answer
time: 2ms
memory: 3392kb
input:
387193259973 268407387361 274058113004 486675093266 437040007372 635497639980
output:
387193259973 -98975799315
result:
wrong answer WA: bad coordinates