답안 #1072484

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1072484 2024-08-23T19:52:15 Z pawned 자동 인형 (IOI18_doll) C++17
2 / 100
24 ms 8540 KB
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops")

#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;

#include "doll.h"

void create_circuit(int M, vi A) {
	int N = A.size();
/*	cout<<"A: ";
	for (int i = 0; i < N; i++) {
		cout<<A[i]<<" ";
	}
	cout<<endl;*/
	vi allr[M + 1];
	allr[0].pb(A[0]);
	for (int i = 0; i < N - 1; i++) {
		allr[A[i]].pb(A[i + 1]);
	}
/*	cout<<"allr: "<<endl;
	for (int i = 0; i < M; i++) {
		cout<<i<<": ";
		for (int x : allr[i])
			cout<<x<<" ";
		cout<<endl;
	}*/
	vi ans(M + 1, 0);
	for (int i = 0; i <= M; i++) {
		if (allr[i].size() != 0)
			ans[i] = allr[i][0];
	}
	// create binary tree
	answer(ans, {}, {});
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 17 ms 6440 KB Output is correct
3 Correct 14 ms 5724 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 3932 KB Output is correct
6 Correct 23 ms 8540 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 17 ms 6440 KB Output is correct
3 Correct 14 ms 5724 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 3932 KB Output is correct
6 Correct 23 ms 8540 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Incorrect 24 ms 6748 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 17 ms 6440 KB Output is correct
3 Correct 14 ms 5724 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 3932 KB Output is correct
6 Correct 23 ms 8540 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Incorrect 24 ms 6748 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -