Submission #105080

# Submission time Handle Problem Language Result Execution time Memory
105080 2019-04-10T13:49:50 Z WLZ Gondola (IOI14_gondola) C++17
10 / 100
45 ms 4620 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;

int valid(int n, int inputSeq[]) {
  int pos = -1;
  set<int> used;
  for (int i = 0; i < n; i++) {
    if (inputSeq[i] <= n) {
      pos = i;
      break;
    }
  }
  if (pos == -1) {
    return 1;
  }
  int cur = inputSeq[pos] - pos;
  if (cur < 1) {
    cur = n - cur;
  }
  for (int i = 0; i < n; i++) {
    if (inputSeq[i] <= n && inputSeq[i] != cur) {
      return 0;
    }
    if (used.count(inputSeq[i])) {
      return 0;
    }
    used.insert(inputSeq[i]);
    cur++;
    if (cur > n) {
      cur = 1;
    }
  }
  return 1;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[]) {
  return -2;
}

//----------------------

int countReplacement(int n, int inputSeq[]) {
  return -3;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 3 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 356 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 0 ms 384 KB Output is correct
6 Correct 19 ms 2304 KB Output is correct
7 Correct 14 ms 768 KB Output is correct
8 Correct 36 ms 4188 KB Output is correct
9 Correct 12 ms 1536 KB Output is correct
10 Correct 45 ms 4600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 300 KB Output is correct
2 Correct 1 ms 432 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 356 KB Output is correct
6 Correct 21 ms 2368 KB Output is correct
7 Correct 15 ms 768 KB Output is correct
8 Correct 40 ms 4044 KB Output is correct
9 Correct 10 ms 1536 KB Output is correct
10 Correct 45 ms 4620 KB Output is correct
11 Correct 3 ms 384 KB Output is correct
12 Correct 2 ms 384 KB Output is correct
13 Correct 9 ms 740 KB Output is correct
14 Incorrect 2 ms 256 KB Output isn't correct
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 428 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 256 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 356 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -