# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1094316 | Sunbae | A Plus B (IOI23_aplusb) | C++17 | 1 ms | 420 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <vector>
#include <algorithm>
#include "aplusb.h"
typedef long long ll;
using namespace std;
const int N = 1e5 + 5;
vector<int> smallest_sums(int n, vector<int> A, vector<int> B) {
ll low = A[0] + B[0], high = A[n-1] + B[n-1], ans;
while(low <= high){
ll mid = low + ((high-low)>>1), cnt = 0;
for(int i = 0; i<n; ++i){
cnt += upper_bound(B.begin(), B.end(), mid-A[i]) - B.begin();
}
if(cnt >= n) high = mid-1, ans = mid;
else low = mid+1;
}
vector<int> v(n);
for(int i = 0, m = 0; i<n; ++i){
for(int j = 0; A[i] + B[j] <= ans && j<n; ++j){
v[m++] = A[i] + B[j];
}
}
sort(v.begin(), v.end());
return v;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |