답안 #50724

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
50724 2018-06-13T05:38:46 Z Talant 곤돌라 (IOI14_gondola) C++17
15 / 100
16 ms 1020 KB
#include "gondola.h"

#include <bits/stdc++.h>

using namespace std;

const int N = 2e6 + 5;

int u[N],mx;
int id;
int mn = 1e9 + 7;

vector <int> v;

int valid(int n, int inputSeq[])
{
      for (int i = 0; i < n; i ++) {
            if (inputSeq[i] < mn)
                  mn = inputSeq[i],id = i;
      }
      int o = mn;
      for (int i = id - 1; i >= 0; i --) {
            mn --;
            if (mn == 0) mn = n;
            if (inputSeq[i] > n)
                  continue;
            if (mn != inputSeq[i])
                  return 0;
      }
      mn = o;
      for (int i = id + 1; i < n; i ++) {
            mn ++;
            if (mn == n + 1) mn = 1;
            if (inputSeq[i] > n)
                  continue;
            if (mn != inputSeq[i])
                  return 0;
      }
      return 1;
}

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

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
      for (int i = 0; i < n; i ++) {
            mx = max(mx,gondolaSeq[i]);
            u[gondolaSeq[i]] = 1;
      }
      for (int i = 1; i <= mx; i ++) {
            if (!u[i])
                  replacementSeq[id ++] = i;
      }
      return id;
}

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

int countReplacement(int n, int inputSeq[])
{
  return -3;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 380 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 428 KB Output is correct
4 Correct 2 ms 484 KB Output is correct
5 Correct 2 ms 484 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 560 KB Output is correct
2 Correct 2 ms 560 KB Output is correct
3 Correct 2 ms 560 KB Output is correct
4 Correct 2 ms 620 KB Output is correct
5 Correct 2 ms 748 KB Output is correct
6 Correct 7 ms 764 KB Output is correct
7 Correct 16 ms 868 KB Output is correct
8 Correct 11 ms 892 KB Output is correct
9 Correct 5 ms 892 KB Output is correct
10 Correct 13 ms 924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 924 KB Output is correct
2 Correct 3 ms 924 KB Output is correct
3 Correct 2 ms 924 KB Output is correct
4 Correct 2 ms 924 KB Output is correct
5 Correct 2 ms 924 KB Output is correct
6 Correct 8 ms 924 KB Output is correct
7 Correct 14 ms 928 KB Output is correct
8 Correct 13 ms 1020 KB Output is correct
9 Correct 5 ms 1020 KB Output is correct
10 Correct 12 ms 1020 KB Output is correct
11 Incorrect 2 ms 1020 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1020 KB Output is correct
2 Correct 2 ms 1020 KB Output is correct
3 Correct 2 ms 1020 KB Output is correct
4 Correct 3 ms 1020 KB Output is correct
5 Correct 3 ms 1020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 1020 KB Output is correct
2 Correct 2 ms 1020 KB Output is correct
3 Correct 2 ms 1020 KB Output is correct
4 Correct 2 ms 1020 KB Output is correct
5 Correct 2 ms 1020 KB Output is correct
6 Correct 3 ms 1020 KB Output is correct
7 Incorrect 3 ms 1020 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1020 KB Output is correct
2 Correct 2 ms 1020 KB Output is correct
3 Correct 2 ms 1020 KB Output is correct
4 Correct 2 ms 1020 KB Output is correct
5 Correct 2 ms 1020 KB Output is correct
6 Correct 2 ms 1020 KB Output is correct
7 Incorrect 2 ms 1020 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1020 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -