結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー umezo
提出日時 2021-10-29 21:36:00
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 2,274 ms
コンパイル使用メモリ 197,968 KB
最終ジャッジ日時 2025-01-25 08:34:24
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n,m;
  cin>>n>>m;
  vector<ll> X(n),Y(m);
  rep(i,n) cin>>X[i];
  rep(i,m) cin>>Y[i];
  sort(ALL(Y));
  
  rep(i,n){
    auto t=lower_bound(ALL(Y),X[i])-Y.begin();
    if(t==m){
      cout<<"Infinity"<<endl;
    }
    else cout<<Y[t]-X[i]<<endl;
  }
  
  

  
  
    
  return 0;
}
0