# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
939828 | AdamGS | A Plus B (IOI23_aplusb) | C++17 | 40 ms | 6164 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "aplusb.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=1e5+7;
ll A[LIM], B[LIM], n;
bool check(ll x) {
ll ile=0;
rep(i, n) {
rep(j, n) {
if(A[i]+B[j]>x) break;
++ile;
if(ile>n) return false;
}
}
return true;
}
vector<int>smallest_sums(int _N, vector<int>_A, vector<int>_B) {
n=_N;
rep(i, n) A[i]=_A[i];
rep(i, n) B[i]=_B[i];
ll po=0, ko=A[n-1]+B[n-1];
while(po<ko) {
ll sr=(po+ko+1)/2;
if(check(sr)) po=sr; else ko=sr-1;
}
vector<int>ans;
rep(i, n) {
rep(j, n) {
if(A[i]+B[j]>po) break;
ans.pb(A[i]+B[j]);
}
}
while(ans.size()<n) ans.pb(po+1);
sort(all(ans));
return ans;
}
컴파일 시 표준 에러 (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... |