結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー PyonPyon
提出日時 2024-05-18 07:43:44
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 731 bytes
コンパイル時間 5,840 ms
コンパイル使用メモリ 322,284 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 16:08:12
合計ジャッジ時間 6,807 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <atcoder/dsu>
#include <atcoder/segtree>
using namespace atcoder;
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
using vi = vector<int>; 
using vvi = vector<vi>; 
using li =vector<ll>;
using lli=vector<li>;
using si =vector<char>;
using ssi =vector<si>;
const long long INF = 1e18;
const long long MOD=1e9+7;
//for (auto [key, val] : mp)
int main() { ll n,m;cin>>n>>m;
li vec(n);
li rec(m+1);
rep(i,0,n)cin>>vec[i];
rep(i,0,m)cin>>rec[i];
rec[m]=INF;
sort(rec.begin(),rec.end());
rep(i,0,n){
	auto t=lower_bound(rec.begin(),rec.end(),vec[i]);
 if(t-rec.begin()==m)cout<<"Infinity"<<endl;
 else cout<<rec[t-rec.begin()]-vec[i]<<endl;
	
}
}
0