답안 #105082

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105082 2019-04-10T13:51:17 Z WLZ 곤돌라 (IOI14_gondola) C++17
10 / 100
20 ms 640 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 (used.count(inputSeq[i])) {
      return 0;
    }
    used.insert(inputSeq[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;
    }
    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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 296 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 8 ms 512 KB Output is correct
7 Correct 13 ms 640 KB Output is correct
8 Correct 11 ms 640 KB Output is correct
9 Correct 4 ms 384 KB Output is correct
10 Correct 18 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 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 256 KB Output is correct
6 Correct 10 ms 512 KB Output is correct
7 Correct 20 ms 640 KB Output is correct
8 Correct 14 ms 612 KB Output is correct
9 Correct 7 ms 384 KB Output is correct
10 Correct 11 ms 640 KB Output is correct
11 Incorrect 2 ms 256 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 384 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 256 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 356 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -