Submission
Status:
PPPPPPTTTT
Subtask/Task Score:
60/100
Score: 60
User: andamanlnwza007
Problemset: กางเต็นท์
Language: cpp
Time: 1.097 second
Submitted On: 2025-10-07 09:31:41
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
int main(){
int hole, hx,hy,n,subx,suby,checkhole=0;
cin>>n;
int holelist[n][2];
for (int i =0 ; i<n ;i++){
cin>>holelist[i][0]>>ws>>holelist[i][1];
}
for (int i = 0 ;i <n ; i++){
hx = holelist[i][0];
hy = holelist[i][1];
for (int j=0 ; j<n ;j++){
if (j>i){
subx = holelist[j][0];
suby = holelist[j][1];
if (abs(hx-subx)==abs(hy-suby) and abs(hx-subx)>checkhole){
checkhole = abs(hx-subx);
}
}
else{
continue;
}
}
}
cout<<checkhole;
}