답안 #740435

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
740435 2023-05-12T13:13:38 Z danikoynov 자동 인형 (IOI18_doll) C++14
2 / 100
31 ms 10012 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int maxn = 2e5 + 10;

int n, m;
vector < int > g[maxn];
void create_circuit(int M, vector<int> A)
{
    n = A.size();
    m = M;

    vector < int > c(m + 1);
    g[0].push_back(A[0]);
    for (int i = 1; i < A.size(); i ++)
    {
        g[A[i - 1]].push_back(A[i]);
    }
    g[A.back()].push_back(0);
    vector < int > x, y;
    for (int i = 0; i <= m; i ++)
    {
        if (g[i].size() == 0)
            c[i] = 0;
        else
        if (g[i].size() == 1)
        c[i] = g[i][0];
    }
    answer(c, x, y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i = 1; i < A.size(); i ++)
      |                     ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 24 ms 8720 KB Output is correct
3 Correct 18 ms 8340 KB Output is correct
4 Correct 2 ms 4948 KB Output is correct
5 Correct 11 ms 6100 KB Output is correct
6 Correct 31 ms 10012 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 24 ms 8720 KB Output is correct
3 Correct 18 ms 8340 KB Output is correct
4 Correct 2 ms 4948 KB Output is correct
5 Correct 11 ms 6100 KB Output is correct
6 Correct 31 ms 10012 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Incorrect 30 ms 8788 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 24 ms 8720 KB Output is correct
3 Correct 18 ms 8340 KB Output is correct
4 Correct 2 ms 4948 KB Output is correct
5 Correct 11 ms 6100 KB Output is correct
6 Correct 31 ms 10012 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Incorrect 30 ms 8788 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4948 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 4948 KB wrong motion
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 4948 KB wrong motion
2 Halted 0 ms 0 KB -