Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
41765 pljplj 【S】T2 C++ 运行超时 87 2000 MS 9656 KB 689 2026-05-29 19:42:16

Tests(34/36):


#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--){ int n; cin>>n; vector<ll> a(n),b(n); for(auto &x:a)cin>>x; for(auto &x:b)cin>>x; sort(a.begin(),a.end()); sort(b.begin(),b.end()); ll res=0; for(int k=0;k<n;k++){ ll mn=LLONG_MAX; for(int i=0;i<n;i++){ int j=(i+k)%n; mn=min(mn,abs(a[i]-b[j])); if(mn<=res) break; } res=max(res,mn); } cout<<res<<'\n'; } }


测评信息: