結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー square1001square1001
提出日時 2021-10-29 21:21:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 655 ms
コンパイル使用メモリ 76,996 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-07 09:25:48
合計ジャッジ時間 1,381 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#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];
	}
	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;
}
0