| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 641851 | knon0501 | Finding Routers (IOI20_routers) | C++14 | 2 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "routers.h"
#include <bits/stdc++.h>;
using namespace std;
const int B = 150;
int c[1005];
int b[200005];
int chk[1005];
std::vector<int> find_routers(int l, int n, int q)
{
vector<int> ans = {0};
// cout<<l<<" "<<n<<" "<<q<<endl;
int j = 1;
int prv = 0;
for (int i = B; i <= l; i += B)
{
int x = use_detector(i);
if(chk[x]==0)chk[x]=i;
for (; j < x; j++)
{
int lef = prv + 1;
int rig = i - 1;
if(chk[j])rig=chk[j]-1;
int k;
while (rig >= lef)
{
int mid = lef + rig >> 1;
int y = use_detector(mid);
if (y < j)
{
k = mid;
lef = mid + 1;
}
else
{
rig = mid - 1;
}
}
ans.push_back(2 * k - ans[j - 1]);
prv = ans[j];
}
}
for (; j < n; j++)
{
int lef = prv + 1;
int rig = l;
int k;
while (rig >= lef)
{
int mid = lef + rig >> 1;
int y = use_detector(mid);
if (y < j)
{
k = mid;
lef = mid + 1;
}
else
{
rig = mid - 1;
}
}
ans.push_back(2 * k - ans[j - 1]);
prv = ans[j];
}
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... | ||||
