結果
| 問題 |
No.1722 [Cherry 3rd Tune C] In my way
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-07-05 07:34:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 468 bytes |
| コンパイル時間 | 806 ms |
| コンパイル使用メモリ | 79,816 KB |
| 最終ジャッジ日時 | 2025-02-15 06:09:04 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
using namespace std;
vector<long long int> vs;
set<long long int> ss;
int main() {
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++){
long long int p1;
cin>>p1;
vs.push_back(p1);
}
for(int i=0;i<m;i++){
long long int p1;
cin>>p1;
ss.insert(p1);
}
for(int i=0;i<n;i++){
auto it=ss.lower_bound(vs[i]);
if(it==ss.end()){
cout<<"Infinity"<<endl;
}else{
cout<<(*it)-vs[i]<<endl;
}
}
return 0;
}
horiesiniti