結果
| 問題 |
No.3325 陰陽師
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-01 15:30:19 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 773 bytes |
| コンパイル時間 | 2,910 ms |
| コンパイル使用メモリ | 288,360 KB |
| 実行使用メモリ | 23,680 KB |
| 最終ジャッジ日時 | 2025-11-01 15:30:35 |
| 合計ジャッジ時間 | 9,784 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 6 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N,M;
cin>>N>>M;
vector<ll> T(M);
set<ll> S;
ll s;
for(int i=0;i<N;i++)cin>>s,S.insert(s);
for(int i=0;i<M;i++)cin>>T[i];
auto NS=S;
for(int i=0;i<M;i++){
auto p=S.lower_bound(T[i]);
if(p==S.end()){
T.resize(i);
break;
}
else{
S.erase(*p);
}
}
if(T.size()==0){
cout<<0<<endl;
return 0;
}
S=NS;
sort(T.begin(),T.end());
ll an=0;
for(int i=0;i<T.size();i++){
auto p=S.lower_bound(T[i]);
S.erase(*p);
an=max(an,(*p)-T[i]);
}
cout<<an<<endl;
}