이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "doll.h"
using namespace std;
vector<pair<int,int>>U;
int Graf[2100009][2];
int h=1;
void F(int n)
{
if(n==2)
{
U.push_back({1,0});
U.push_back({1,1});
return;
}
F((n+1)/2);
vector<pair<int,int>>A,B;
if(n%2==0)
{
for(auto[v,u] : U)
{
h++;
Graf[v][u]=h;
A.push_back({h,0});
B.push_back({h,1});
}
}
else
{
bool CzyPierwszy=1;
for(auto[v,u] : U)
{
h++;
Graf[v][u]=h;
if(CzyPierwszy)
{
CzyPierwszy=0;
Graf[h][1]=1;
A.push_back({h,0});
B.push_back({-1,-1});
}
else
{
A.push_back({h,0});
B.push_back({h,1});
}
}
}
U.clear();
for(auto xd : A)
{
U.push_back(xd);
}
for(auto xd : B)
{
if(xd.first==-1){continue;}
U.push_back(xd);
}
}
void create_circuit(int M, vector<int>A)
{
A.push_back(0);
F(A.size());
vector<int>C(M+1,-1);
vector<int>X(h),Y(h);
for(int i=1;i<=h;i++)
{
X[i-1]=-Graf[i][0];
Y[i-1]=-Graf[i][1];
}
for(int i=0;i<(int)U.size();i++)
{
if(U[i].second==0)
{
X[U[i].first-1]=A[i];
}
else
{
Y[U[i].first-1]=A[i];
}
}
answer(C, X, Y);
}
컴파일 시 표준 에러 (stderr) 메시지
doll.cpp: In function 'void F(int)':
doll.cpp:19:17: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
19 | for(auto[v,u] : U)
| ^
doll.cpp:30:17: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
30 | for(auto[v,u] : U)
| ^
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |