fix: removing duplicated tests and correcting some small solutions

This commit is contained in:
2026-05-04 15:35:34 -03:00
parent 9c0eca4a3f
commit c2d1d60303
129 changed files with 255835 additions and 255622 deletions

View File

@@ -2,22 +2,24 @@
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; i++)
cin >> nums[i];
int main(){
int t; cin >> t;
while (t--) {
int n; cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; i++) cin >> nums[i];
sort(nums.begin(), nums.end());
int minDiff = INT_MAX;
for (int i = 1; i < n; i++) {
minDiff = min(minDiff, nums[i] - nums[i - 1]);
}
cout << minDiff << endl;
}
return 0;
sort(nums.begin(), nums.end());
int minDiff = numeric_limits<int>::min();
for (int i = 1; i < n; i+=2) {
minDiff = max(minDiff, nums[i] - nums[i - 1]);
}
cout << minDiff << endl;
}
return 0;
}