답안 #1010373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1010373 2024-06-29T02:24:52 Z HappyCapybara 자동 인형 (IOI18_doll) C++17
6 / 100
39 ms 12848 KB
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;

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

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:8:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   for (int i=0; i<A.size()-1; i++) v[A[i]].push_back(A[i+1]);
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 15 ms 6784 KB Output is correct
3 Correct 13 ms 5716 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 3928 KB Output is correct
6 Correct 22 ms 8360 KB Output is correct
7 Correct 0 ms 356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 15 ms 6784 KB Output is correct
3 Correct 13 ms 5716 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 3928 KB Output is correct
6 Correct 22 ms 8360 KB Output is correct
7 Correct 0 ms 356 KB Output is correct
8 Correct 24 ms 8280 KB Output is correct
9 Correct 27 ms 9552 KB Output is correct
10 Correct 37 ms 12848 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 15 ms 6784 KB Output is correct
3 Correct 13 ms 5716 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 6 ms 3928 KB Output is correct
6 Correct 22 ms 8360 KB Output is correct
7 Correct 0 ms 356 KB Output is correct
8 Correct 24 ms 8280 KB Output is correct
9 Correct 27 ms 9552 KB Output is correct
10 Correct 37 ms 12848 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 352 KB Output is correct
14 Incorrect 39 ms 9764 KB wrong motion
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 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 -