結果
| 問題 |
No.1722 [Cherry 3rd Tune C] In my way
|
| コンテスト | |
| ユーザー |
t33f
|
| 提出日時 | 2021-10-29 22:17:39 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 512 bytes |
| コンパイル時間 | 839 ms |
| コンパイル使用メモリ | 71,528 KB |
| 最終ジャッジ日時 | 2025-01-25 09:03:47 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include <vector>
#include <iostream>
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];
for (int i = 0; i < n; i++) {
constexpr int INF = 1 << 30;
int stop = INF;
for (int j = 0; j < m; j++) {
if (y[j] > x[i]) stop = min(stop, y[j]);
}
if (stop == INF) cout << "Infinity\n";
else cout << stop - x[i] << '\n';
}
}
t33f