Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(x) (x).begin(), (x).end()
#define f(i, n) for (int i = 0; i < n; i++)
#define trace(x) cerr << #x << ": " << x << '\n'
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> v(n);
f(i, n) cin >> v[i];
sort(all(v));
cout << v.back() - v[n - 2] << '\n';
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1208 C. Game on Integer
- Contest
- Educational Round 1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-14 16:03:43
- Judged At
- 2025-07-14 16:03:43
- Judged By
- Score
- 5
- Total Time
- 36ms
- Peak Memory
- 536.0 KiB