답안 #50469

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
50469 2018-06-11T05:30:56 Z mirbek01 곤돌라 (IOI14_gondola) C++17
20 / 100
31 ms 2284 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[])
{
      vector <pair <int, int> > v;
      for(int i = 0; i < n; i ++)
            if(inputSeq[i] <= n)
                  v.push_back({inputSeq[i], i + 1});
      sort(v.begin(), v.end());
      for(int i = 1; i < v.size(); i ++){
            int ab = v[i].first - v[i - 1].first, ds;
            if(v[i].second > v[i - 1].second){
                  ds = v[i].second - v[i - 1].second;
            } else {
                  ds = v[i].second + (n - v[i - 1].second);
            }
            if(ds != ab) return 0;
      }
      sort(inputSeq, inputSeq + n);
      for(int i = 1; i < n; i ++){
            if(inputSeq[i] == inputSeq[i - 1]) return 0;
      }
      return 1;
}

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

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

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

int countReplacement(int n, int inputSeq[])
{
      return -3;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:11:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i = 1; i < v.size(); i ++){
                      ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 472 KB Output is correct
3 Correct 2 ms 472 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 512 KB Output is correct
6 Correct 13 ms 1300 KB Output is correct
7 Correct 23 ms 2064 KB Output is correct
8 Correct 20 ms 2064 KB Output is correct
9 Correct 10 ms 2064 KB Output is correct
10 Correct 29 ms 2064 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2064 KB Output is correct
2 Correct 2 ms 2064 KB Output is correct
3 Correct 2 ms 2064 KB Output is correct
4 Correct 2 ms 2064 KB Output is correct
5 Correct 2 ms 2064 KB Output is correct
6 Correct 13 ms 2064 KB Output is correct
7 Correct 22 ms 2200 KB Output is correct
8 Correct 18 ms 2200 KB Output is correct
9 Correct 9 ms 2200 KB Output is correct
10 Correct 31 ms 2200 KB Output is correct
11 Correct 2 ms 2200 KB Output is correct
12 Correct 2 ms 2200 KB Output is correct
13 Correct 7 ms 2200 KB Output is correct
14 Correct 2 ms 2200 KB Output is correct
15 Correct 21 ms 2284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2284 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2284 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2284 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 2284 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2284 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2284 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2284 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -