답안 #244066

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
244066 2020-07-02T14:10:39 Z crossing0ver 자동 인형 (IOI18_doll) C++17
6 / 100
107 ms 11064 KB
#include<bits/stdc++.h>
#define pb push_back
#define vi vector<int>
#define fi first
#define se second
//#define local

#ifndef local
#include "doll.h"
#endif
using namespace std;

void create_circuit(int M, vi A) {
  int n = A.size();
  vi C(M+1);
  vector<int> X, Y;
  vector<vector<int> >  F(M+1);
  int num = 0;
  C[0] = A[0];
  for (int i = 0; i < n; ++i) {
  	if (C[A[i]] == 0) C[A[i]] = -(++num);
  	int id = -C[A[i]];
  	F[id].pb((i != n-1 ?  A[i+1] : 0));
  }
  for (auto i = 1; i <= M; i++) {
  	if (F[i].size() == 0) continue;
  	if (F[i].size() == 1) X.pb(-i), Y.pb(F[i][0]);
  	else X.pb(F[i][0]), Y.pb(F[i][1]);
  }
  answer(C, X, Y);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 43 ms 7852 KB Output is correct
3 Correct 53 ms 6688 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 13 ms 3788 KB Output is correct
6 Correct 84 ms 10276 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 43 ms 7852 KB Output is correct
3 Correct 53 ms 6688 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 13 ms 3788 KB Output is correct
6 Correct 84 ms 10276 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 69 ms 7204 KB Output is correct
9 Correct 69 ms 9884 KB Output is correct
10 Correct 107 ms 11064 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 43 ms 7852 KB Output is correct
3 Correct 53 ms 6688 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 13 ms 3788 KB Output is correct
6 Correct 84 ms 10276 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 69 ms 7204 KB Output is correct
9 Correct 69 ms 9884 KB Output is correct
10 Correct 107 ms 11064 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Incorrect 84 ms 8060 KB wrong motion
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -