Submission #139373

# Submission time Handle Problem Language Result Execution time Memory
139373 2019-07-31T15:27:02 Z ly20 Mechanical Doll (IOI18_doll) C++17
2 / 100
27 ms 2252 KB
#include <bits/stdc++.h>

#include "doll.h"

using namespace std;

const int MAXN=212345;

#define debug(args...) fprintf(stderr,args)

int freq[MAXN];

void create_circuit(int m, vector<int> a) {
  int n = a.size();
  vector<int> c(m+1),x,y;
  for(int i=0;i<m+1;i++)c[i]=0;
  for(int i=0;i<n-1;i++)
  {
    if(freq[a[i]]>0)
    {
      x.push_back(c[a[n-1]]);
      y.push_back(a[i+1]);
      c[a[i]]=-x.size();
    }
    else c[a[i]]=a[i+1];
  }
  if(freq[a[n-1]]>0)
  {
    x.push_back(c[a[n-1]]);
    y.push_back(0);
    c[a[n-1]]=-x.size();
  }
  else c[a[n-1]]=0;
  c[0]=a[0];
  answer(c,x,y);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 21 ms 1980 KB Output is correct
3 Correct 20 ms 1612 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 14 ms 1484 KB Output is correct
6 Correct 27 ms 2252 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 21 ms 1980 KB Output is correct
3 Correct 20 ms 1612 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 14 ms 1484 KB Output is correct
6 Correct 27 ms 2252 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Incorrect 26 ms 2124 KB wrong motion
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 21 ms 1980 KB Output is correct
3 Correct 20 ms 1612 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 14 ms 1484 KB Output is correct
6 Correct 27 ms 2252 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Incorrect 26 ms 2124 KB wrong motion
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB wrong motion
2 Halted 0 ms 0 KB -