結果
| 問題 |
No.1722 [Cherry 3rd Tune C] In my way
|
| コンテスト | |
| ユーザー |
Today03
|
| 提出日時 | 2021-10-29 21:53:13 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 512 bytes |
| コンパイル時間 | 2,327 ms |
| コンパイル使用メモリ | 197,620 KB |
| 最終ジャッジ日時 | 2025-01-25 08:49:51 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
int32_t 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++) {
auto itr = upper_bound(y.begin(), y.end(), x[i]);
int ans = *itr - x[i];
if (ans < 0) cout << "Infinity" << endl;
else cout << ans << endl;
}
}
Today03