답안 #845169

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
845169 2023-09-06T12:24:44 Z 12345678 자동 인형 (IOI18_doll) C++17
6 / 100
52 ms 12484 KB
#include "doll.h"
#include <bits/stdc++.h>

using namespace std;

void create_circuit(int M, std::vector<int> A) {
    int cnt=0;
    vector<int> C(M+1), X, Y;
    vector<vector<int>> v(M+1);
    v[0].push_back(A[0]);
    for (int i=0; i<A.size()-1; i++) v[A[i]].push_back(A[i+1]);
    v[A[A.size()-1]].push_back(0);
    for (int i=0; i<=M; i++)
    {
        if (v[i].size()==0) continue;
        if (v[i].size()==1) C[i]=v[i][0];
        else C[i]=--cnt, X.push_back(v[i][0]), Y.push_back(v[i][1]);
    }
    answer(C, X, Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:11:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int i=0; i<A.size()-1; i++) v[A[i]].push_back(A[i+1]);
      |                   ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 19 ms 6748 KB Output is correct
3 Correct 15 ms 5720 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 8 ms 3932 KB Output is correct
6 Correct 24 ms 8540 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 19 ms 6748 KB Output is correct
3 Correct 15 ms 5720 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 8 ms 3932 KB Output is correct
6 Correct 24 ms 8540 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 33 ms 8116 KB Output is correct
9 Correct 35 ms 9524 KB Output is correct
10 Correct 52 ms 12484 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 19 ms 6748 KB Output is correct
3 Correct 15 ms 5720 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 8 ms 3932 KB Output is correct
6 Correct 24 ms 8540 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 33 ms 8116 KB Output is correct
9 Correct 35 ms 9524 KB Output is correct
10 Correct 52 ms 12484 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Incorrect 41 ms 9644 KB wrong motion
15 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 -