답안 #75244

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
75244 2018-09-08T20:10:18 Z vasilepetr 자동 인형 (IOI18_doll) C++14
2 / 100
31 ms 2228 KB
#include "doll.h"
#include<iostream>
using namespace std;

void create_circuit(int M, std::vector<int> A) {
  int N = A.size();
  //int viz[M+10];
  std::vector<int> C(M + 1);
  C[0] = -1;
  int p=0;
  for (int i = 0; i < A.size(); ++i) {
    C[p]=A[i];
   // viz[p]=1;
    p=A[i];
  }

 /* for (int i=1; i<=M; i++) {
    if (C[i]==0 && !viz[p]) C[i]=0;
  }*/
  //for (int i=0; i<C.size();i++) cout<<C[i]<<" ";cout<<'\n';
  std::vector<int> X(0), Y(0);
  answer(C, X, Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:11:21: 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(); ++i) {
      |                   ~~^~~~~~~~~~
doll.cpp:6:7: warning: unused variable 'N' [-Wunused-variable]
    6 |   int N = A.size();
      |       ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 23 ms 1968 KB Output is correct
3 Correct 22 ms 1484 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 11 ms 1356 KB Output is correct
6 Correct 25 ms 2228 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 23 ms 1968 KB Output is correct
3 Correct 22 ms 1484 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 11 ms 1356 KB Output is correct
6 Correct 25 ms 2228 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 31 ms 1996 KB wrong motion
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 23 ms 1968 KB Output is correct
3 Correct 22 ms 1484 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 11 ms 1356 KB Output is correct
6 Correct 25 ms 2228 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 31 ms 1996 KB wrong motion
9 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 -