답안 #823148

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
823148 2023-08-12T08:33:37 Z Trumling 자동 인형 (IOI18_doll) C++14
6 / 100
53 ms 8720 KB
#include "doll.h"
#include<bits/stdc++.h>
using namespace  std;
#define F first 
#define S second 
#define all(x) x.begin(),x.end()  
typedef long long ll;
#define INF 99999999999999
#define pb  push_back

void create_circuit(int M, std::vector<int> A) {
  int N = A.size()+1;
  A.pb(0);
  vector<int> C(M + 1);
  vector<bool>vis(M+1,0);
  vector<int>sw(M+1,0);
  ll idx=0;

  vector<int> X, Y;
  C[0]=A[0];
  for(int i=0;i<N-1;i++)
  {
    if(!vis[A[i]])
    {
        vis[A[i]]=1;
        C[A[i]]=-(idx+1);
        X.pb(-(idx+1));
        Y.pb(A[i+1]);
        sw[A[i]]=idx++;
        continue;
    }
    ll curr=sw[A[i]];
    X[curr]=Y[curr];
    Y[curr]=A[i+1];
  }
  answer(C, X, Y);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 27 ms 4272 KB Output is correct
3 Correct 21 ms 4696 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 8 ms 1832 KB Output is correct
6 Correct 32 ms 6620 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 27 ms 4272 KB Output is correct
3 Correct 21 ms 4696 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 8 ms 1832 KB Output is correct
6 Correct 32 ms 6620 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 29 ms 5152 KB Output is correct
9 Correct 40 ms 7564 KB Output is correct
10 Correct 53 ms 8720 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 0 ms 300 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 27 ms 4272 KB Output is correct
3 Correct 21 ms 4696 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 8 ms 1832 KB Output is correct
6 Correct 32 ms 6620 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 29 ms 5152 KB Output is correct
9 Correct 40 ms 7564 KB Output is correct
10 Correct 53 ms 8720 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 0 ms 300 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Incorrect 33 ms 6676 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 -