QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#198436 | #3525. Move & Meet | Anwar# | WA | 0ms | 3860kb | C++20 | 1005b | 2023-10-03 13:53:09 | 2023-10-03 13:53:10 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 3, MOD = 998244353;//1e9 + 7;
int32_t main() {
cin.tie(0);cin.sync_with_stdio(0);
cout.tie(0);cout.sync_with_stdio(0);
vector<vector<ll> > a(2 , vector<ll> (3)) ;
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 3; ++j) {
cin >> a[i][j] ;
}
}
ll dis = abs(a[0][0] - a[1][0]) + abs( a[0][1] - a[1][1] ) ;
if(dis > a[0][2] + a[1][2] || dis%2 != (a[0][2] + a[1][2])%2 ) return cout << "impossible" , 0 ;
if(a[0][2] > a[1][2]) swap(a[1], a[0]) ;
dis = min( dis - ( dis%2 != a[0][2]%2 ) , a[0][2] ) ;
int x ;
if(a[1][0] > a[0][0]) x = min( a[1][0] , a[0][0] + dis ) ;
else x = max( a[1][0] , a[0][0] - dis ) ;
dis -= abs(x - a[0][0]);
if(a[1][1] > a[0][1]) cout << x << " " << min(a[1][1] , a[0][1] + dis) ;
else cout << x << " " << max(a[1][1] , a[0][1] - dis) ;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3788kb
input:
-1 -2 0 1 2 6
output:
-1 -2
result:
ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
1 -2 5 -3 3 8
output:
-3 -1
result:
ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
0 -1000000000000 0 0 -1000000000000 0
output:
0 -1000000000000
result:
ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
-5 -426 932111 83 -870 478692
output:
impossible
result:
ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
4 5 6 4 -2 1
output:
4 -1
result:
ok
Test #6:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
0 0 2 2 2 2
output:
2 0
result:
ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
0 0 1000000000000 5 19923 186
output:
0 19742
result:
ok
Test #8:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
-237700907237 445576550446 594610055595 681973265681 -171560526172 843757392844
output:
impossible
result:
ok
Test #9:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
-537351556538 -807721987807 690465417691 287415372288 977794499977 17905823179
output:
impossible
result:
ok
Test #10:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
30 40 100000 -120 1 100
output:
impossible
result:
ok
Test #11:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
267127854709 343405973674 26161892148 381294549365 370274347369 145141827064
output:
impossible
result:
ok
Test #12:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
-31878165543 682414817093 568347503685 70100797810 257224740065 112811330402
output:
-1813394471 298121878186
result:
ok
Test #13:
score: -100
Wrong Answer
time: 0ms
memory: 3656kb
input:
387193259973 268407387361 274058113004 486675093266 437040007372 635497639980
output:
1343788818 150672369510
result:
wrong answer WA: bad coordinates