| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 439155 | hossain2020 | Shopping (JOI21_shopping) | C++14 | 156 ms | 12024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
int n, l, r;
int c,o;
} // namespace
vector <long long > v;
void InitA(int N, int L, int R) {
n= N;
l= L;
r= R;
int a=r-l;
for (int i=0;i<18;i++)
{
SendA(a%2);
a/=2;
}
}
void ReceiveA(bool x)
{
o+=(1<<c)*int(x);
c++;
if (c==20)
{
c=0;
v.push_back(o);
o=0;
}
}
int Answer() {
v.push_back(n+5);
for (int i=0;i<v.size();i++)
{
if (v[i]==v[i+1])
{
if (v[i]>=l&&v[i]<=r)
{
return v[i];
}
i++;
}
else if (v[i]<=r&&v[i]>=l&&v[i+1]>r)
{
return v[i];
}
}
}
#include "Bruno.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
int n;
int a[1000000];
int co,o,b,c;
}
void send(int y)
{
for (int i=0;i<20;i++)
{
SendB(y%2);
y/=2;
}
}
void InitB(int N, std::vector<int> P) {
n= N;
for(int i = 0; i < N; i++) {
a[i]= P[i];
}
}
void ReceiveB(bool y) {
o+=(1<<co)*int(y);
co++;
if (co==18)
{
for (int i=0;i<n;)
{
if (b==0)
{
b=a[i];
c=i;
for (int j=i+1;j-i<=o;j++)
{
if (a[j]<b)
{
b=a[j];
c=j;
}
}
send(c);
}
else
{
for (int j=i+1;j-i<=o;j++)
{
if (a[j]<b)
{
b=a[j];
c=j;
}
}
send (c);
if (c==i)
{
if (n-i-1<=o)return;
i++;
b=0;
}
else i=c;
}
}
}
}
컴파일 시 표준 에러 (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... | ||||
