답안 #713747

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
713747 2023-03-23T02:10:13 Z PixelCat 자동 인형 (IOI18_doll) C++14
6 / 100
75 ms 11048 KB
#ifdef NYAOWO
#include "grader.cpp"
#define OUT_VEC(x) { cout << #x << ":"; { for(auto &IT:x) cout << " " << IT; } cout << "\n"; }
#else
#define OUT_VEC(x)
#endif
#include "doll.h"

#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
using namespace std;
using LL = long long;
using pii = pair<int, int>;

const int MAXM = 100010;

void create_circuit(int M, std::vector<int> A) {
    vector<vector<int>> adj(M + 1, vector<int>());
    vector<int> x, y;
    int n = sz(A);
    For(i, 0, n - 2) {
        adj[A[i]].eb(A[i + 1]);
    }
    adj[A.back()].eb(0);
    vector<int> ans(M + 1);
    ans[0] = A[0];
    For(i, 1, M) {
        if(sz(adj[i]) == 0) {
            ans[i] = 0;
        } else if(sz(adj[i]) == 1) {
            ans[i] = adj[i][0];
        } else {
            int tot = sz(adj[i]);
            int now = sz(x) + 1;
            ans[i] = -now;
            For(j, 0, tot - 3) {
                x.eb(adj[i][j]);
                y.eb(-(now + 1));
                now++;
            }
            x.eb(adj[i][tot - 2]);
            y.eb(adj[i][tot - 1]);
        }
    }
    OUT_VEC(ans);
    OUT_VEC(x);
    OUT_VEC(y);
    answer(ans, x, y);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 24 ms 6284 KB Output is correct
3 Correct 20 ms 5204 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 11 ms 3796 KB Output is correct
6 Correct 31 ms 7644 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 24 ms 6284 KB Output is correct
3 Correct 20 ms 5204 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 11 ms 3796 KB Output is correct
6 Correct 31 ms 7644 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 43 ms 7204 KB Output is correct
9 Correct 47 ms 8628 KB Output is correct
10 Correct 75 ms 11048 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 24 ms 6284 KB Output is correct
3 Correct 20 ms 5204 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 11 ms 3796 KB Output is correct
6 Correct 31 ms 7644 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 43 ms 7204 KB Output is correct
9 Correct 47 ms 8628 KB Output is correct
10 Correct 75 ms 11048 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Incorrect 63 ms 9452 KB wrong motion
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB wrong motion
2 Halted 0 ms 0 KB -