結果
問題 |
No.1722 [Cherry 3rd Tune C] In my way
|
ユーザー |
👑 ![]() |
提出日時 | 2021-09-23 04:24:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 620 ms |
コンパイル使用メモリ | 69,504 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-07 09:09:03 |
合計ジャッジ時間 | 1,542 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include<iostream> #include<vector> using namespace std; int min(int x, int y){ if (x<y) return x; else return y; } int main(){ int N,M; cin >> N >> M; vector<int> X(N), Y(M); for (int i=0; i<N; i++) cin >> X[i]; for (int j=0; j<M; j++) cin >> Y[j]; int infty=1001001001; int z=0; for (auto x:X){ z=infty; for (auto y:Y){ if (x<y){ z=min(z,y); } } if (z==infty){ cout << "Infinity" << endl; }else{ cout << z-x << endl; } } }