Submission #1065032

# Submission time Handle Problem Language Result Execution time Memory
1065032 2024-08-18T21:29:55 Z hyakup Mechanical Doll (IOI18_doll) C++17
6 / 100
54 ms 8428 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;

void create_circuit(int M, vector<int> A ) {
  A.push_back(0);
  int n = A.size(), m = M;
  vector<int> c(m + 1), x, y;
  c[0] = A[0];
  for( int i = 0; i + 1 < n; i++ ){
    if( c[A[i]] == 0 ){
      int id = x.size() + 1;
      x.push_back(-id);
      y.push_back(-id);
      c[A[i]] = -id;
    }
    swap( x[-c[A[i]] - 1], y[-c[A[i]] - 1] );
    y[-c[A[i]] - 1] = A[i + 1];
  }
  // for( int i = 0; i <= m; i++ ) cout << c[i] << endl;
  // for( int i = 0 ;i < x.size(); i++ ) cout << x[i] << " " << y[i] << endl;
  answer( c, x, y );
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 28 ms 4020 KB Output is correct
3 Correct 17 ms 4720 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 8 ms 1372 KB Output is correct
6 Correct 34 ms 6724 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 28 ms 4020 KB Output is correct
3 Correct 17 ms 4720 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 8 ms 1372 KB Output is correct
6 Correct 34 ms 6724 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 30 ms 5716 KB Output is correct
9 Correct 34 ms 7288 KB Output is correct
10 Correct 38 ms 8428 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 28 ms 4020 KB Output is correct
3 Correct 17 ms 4720 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 8 ms 1372 KB Output is correct
6 Correct 34 ms 6724 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 30 ms 5716 KB Output is correct
9 Correct 34 ms 7288 KB Output is correct
10 Correct 38 ms 8428 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Incorrect 54 ms 6420 KB wrong motion
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB wrong motion
2 Halted 0 ms 0 KB -