이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "doll.h"
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")
#define F first
#define S second
#define sz(x) int(x.size())
#define pb push_back
#define pf push_front
#define N 100005
#define M ll(998244353)
#define inf 1e9 + 1e9
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef short int si;
typedef array <ll, 3> a3;
typedef array <ll, 4> a4;
void create_circuit (int m, vector <int> a)
{
int n = sz(a);
vector <int> c(m + 1), x, y; x.clear(); y.clear();
for (int i = 0; i <= m; i++) c[i] = 1e9;
c[0] = a[0];
for (int i = 0; i < n; i++)
if (i + 1 == n) {if (c[a[i]] == 1e9) c[a[i]] = 0; else {x.pb(c[a[i]]); y.pb(0); c[a[i]] = -sz(x);}}
else if (c[a[i]] == 1e9) c[a[i]] = a[i + 1]; else {x.pb(c[a[i]]); y.pb(a[i + 1]); c[a[i]] = -sz(x);}
for (int i = 0; i <= m; i++) if (c[i] == 1e9) c[i] = 0;
answer(c, x, y);
}
| # | 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... |