이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define eps (double)1e-9
#define PI 2*acos(0.0)
#define endl "\n"
#define sz(v) (int)(v).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
void create_circuit(int M, vector<int> A) {
vector <int> connected(M+1), x, y;
int i;
vector <int> flag(M+1);
for(auto &to : connected) to = 0;
vector <pii> to(M+1, {2e9, 2e9});
A.pb(0);
connected[0] = A[0];
for(i = 0; i < sz(A)-1; i++){
if(to[A[i]].first == 2e9) to[A[i]].first = A[i+1];
else to[A[i]].second = A[i+1];
}
for(i = 0; i < sz(A)-1; i++){
if(to[A[i]].second != 2e9 && !flag[A[i]]){
x.pb(to[A[i]].first);
y.pb(to[A[i]].second);
connected[A[i]] = -sz(x);
flag[A[i]] = 1;
}
else if(!flag[A[i]]){
connected[A[i]] = A[i+1];
}
}
/*
for(auto to : connected) cout << to << ' ';
cout << endl;
for(i = 0; i < sz(x); i++) cout << x[i] << ' ' << y[i] << endl;
*/
answer(connected, 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... |