QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#133416 | #4943. Police Stations | S_Explosion# | WA | 1ms | 3824kb | C++20 | 721b | 2023-08-02 09:14:28 | 2023-08-02 09:14:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n,mnx,mxx,mny,mxy;
inline int read() {
int x = 0;
bool f = true; char ch = getchar();
for ( ; ch < '0' || ch > '9'; ch = getchar()) f ^= ch == '-';
for ( ; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + (ch ^ 48);
x = f ? x : -x;
return x;
}
int main() {
n=read();
mnx=mny=1e9,mxx=mxy=-1e9;
for(int i=1;i<=n;i++){
int x=read(),y=read();
mnx=min(x,mnx),mxx=max(mxx,x);
mny=min(y,mny),mxy=max(mxy,y);
}
// printf("%d %d %d %d\n",mnx,mxx,mny,mxy);
int midx=(mnx+mxx+1)/2,midy=(mny+mxy+1)/2;
printf("%d %d",max(midx-mnx,mxx-midx),max(midy-mny,mxy-midy));
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3820kb
input:
5 20 90 -10 40 90 20 50 -30 50 70
output:
50 60
result:
ok single line: '50 60'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
2 120 740 122 749
output:
1 5
result:
ok single line: '1 5'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
5 -30 -7 2 80 23 15 31 30 92 -20
output:
61 50
result:
ok single line: '61 50'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 -1 1 1 -1
output:
1 1
result:
ok single line: '1 1'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
1 0 0
output:
0 0
result:
ok single line: '0 0'
Test #6:
score: 0
Accepted
time: 1ms
memory: 3776kb
input:
1 97874 185956
output:
0 0
result:
ok single line: '0 0'
Test #7:
score: -100
Wrong Answer
time: 1ms
memory: 3596kb
input:
10 430700 688911 205798 716277 90011 694885 -152500 247408 292079 -231064 -124629 -404797 783947 -886549 927759 -454565 -232945 -44455 583806 624703
output:
580352 801414
result:
wrong answer 1st lines differ - expected: '580352 801413', found: '580352 801414'