Submission #50468

# Submission time Handle Problem Language Result Execution time Memory
50468 2018-06-11T05:26:27 Z mirbek01 Gondola (IOI14_gondola) C++17
10 / 100
29 ms 5664 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;
      }
      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 ++){
                      ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 436 KB Output is correct
4 Correct 3 ms 440 KB Output is correct
5 Correct 2 ms 536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 572 KB Output is correct
2 Correct 3 ms 584 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 3 ms 600 KB Output is correct
5 Correct 3 ms 604 KB Output is correct
6 Correct 12 ms 1500 KB Output is correct
7 Correct 22 ms 2732 KB Output is correct
8 Correct 16 ms 3124 KB Output is correct
9 Correct 7 ms 3124 KB Output is correct
10 Correct 21 ms 3824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 3824 KB Output is correct
2 Correct 2 ms 3824 KB Output is correct
3 Correct 2 ms 3824 KB Output is correct
4 Correct 2 ms 3824 KB Output is correct
5 Correct 2 ms 3824 KB Output is correct
6 Correct 11 ms 3824 KB Output is correct
7 Correct 29 ms 4608 KB Output is correct
8 Correct 17 ms 5000 KB Output is correct
9 Correct 7 ms 5000 KB Output is correct
10 Correct 22 ms 5664 KB Output is correct
11 Incorrect 2 ms 5664 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5664 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5664 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5664 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5664 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5664 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5664 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5664 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -