結果
問題 |
No.1722 [Cherry 3rd Tune C] In my way
|
ユーザー |
|
提出日時 | 2022-07-19 12:35:32 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 582 bytes |
コンパイル時間 | 1,402 ms |
コンパイル使用メモリ | 130,488 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 14:31:58 |
合計ジャッジ時間 | 2,382 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<cmath> #include<string> #include<iomanip> #include<numeric> #include<queue> #include<deque> #include<stack> #include<set> #include<map> #include<random> using namespace std; typedef long long ll; const int mod=1e9+7; int main(){ int n,m,x[1000],y[1000]; cin>>n>>m; for(int i=0;i<n;i++) cin>>x[i]; for(int i=0;i<m;i++) cin>>y[i]; for(int i=0;i<n;i++){ int ans=mod; for(int j=0;j<m;j++) if(y[j]>=x[i]) ans=min(ans,y[j]); if(ans==mod) cout<<"Infinity"<<endl; else cout<<ans-x[i]<<endl; } }