結果
問題 |
No.1722 [Cherry 3rd Tune C] In my way
|
ユーザー |
![]() |
提出日時 | 2021-10-29 21:22:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 496 bytes |
コンパイル時間 | 731 ms |
コンパイル使用メモリ | 80,312 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-07 09:29:40 |
合計ジャッジ時間 | 1,563 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <cmath> #include <string> #include <vector> #include <iostream> #include <algorithm> using namespace std; 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 i = 0; i < M; ++i) { cin >> Y[i]; } sort(Y.begin(), Y.end()); for (int i = 0; i < N; ++i) { int ptr = lower_bound(Y.begin(), Y.end(), X[i]) - Y.begin(); if (ptr != M) cout << Y[ptr] - X[i] << endl; else cout << "Infinity" << endl; } return 0; }